Author: miguel
Date: 2007-06-19 13:37:38 -0400 (Tue, 19 Jun 2007)
New Revision: 80209

Modified:
   trunk/olive/class/agclr/Internal.cs
   trunk/olive/class/agclr/Mono/NativeMethods.cs
Log:
Add support for insert

Modified: trunk/olive/class/agclr/Internal.cs
===================================================================
--- trunk/olive/class/agclr/Internal.cs 2007-06-19 17:32:31 UTC (rev 80208)
+++ trunk/olive/class/agclr/Internal.cs 2007-06-19 17:37:38 UTC (rev 80209)
@@ -53,23 +53,32 @@
                {
                }
                
-               public void Add (T t)
+               public void Add (T value)
                {
-                       DependencyObject dob = t as DependencyObject;
+                       DependencyObject dob = value as DependencyObject;
                        if (dob != null)
                                NativeMethods.collection_add (native, 
dob.native);
                        else
                                throw new Exception ("The collection only 
supports DependencyObjects");
                }
 
-               public void Remove (T t)
+               public void Remove (T value)
                {
-                       DependencyObject dob = t as DependencyObject;
+                       DependencyObject dob = value as DependencyObject;
                        if (dob != null)
                                NativeMethods.collection_remove (native, 
dob.native);
                        else
                                throw new Exception ("The collection only 
supports DependencyObjects");
                }
+
+               public void Insert (int index, T value)
+               {
+                       DependencyObject dob = value as DependencyObject;
+                       if (dob != null)
+                               NativeMethods.collection_insert (native, index, 
dob.native);
+                       else
+                               throw new Exception ("The collection only 
supports DependencyObjects");
+               }
                
                protected internal override Kind GetKind ()
                {

Modified: trunk/olive/class/agclr/Mono/NativeMethods.cs
===================================================================
--- trunk/olive/class/agclr/Mono/NativeMethods.cs       2007-06-19 17:32:31 UTC 
(rev 80208)
+++ trunk/olive/class/agclr/Mono/NativeMethods.cs       2007-06-19 17:37:38 UTC 
(rev 80209)
@@ -173,6 +173,9 @@
                internal extern static void collection_remove (IntPtr 
collection, IntPtr value);
 
                [DllImport("moon")]
+               internal extern static void collection_insert (IntPtr 
collection, int index, IntPtr value);
+
+               [DllImport("moon")]
                internal extern static IntPtr collection_get_iterator (IntPtr 
collection);
 
                [DllImport("moon")]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to