Author: krasnov
Date: 2008-01-03 11:25:53 -0500 (Thu, 03 Jan 2008)
New Revision: 92187

Modified:
   trunk/mcs/class/System/System.ComponentModel/ChangeLog
   trunk/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
Log:
* TypeDescriptor.cs: fixed properties order in returning collections in 
PropertyDescriptorCollection

Modified: trunk/mcs/class/System/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/ChangeLog      2008-01-03 
16:12:03 UTC (rev 92186)
+++ trunk/mcs/class/System/System.ComponentModel/ChangeLog      2008-01-03 
16:25:53 UTC (rev 92187)
@@ -1,3 +1,8 @@
+2008-01-03  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * TypeDescriptor.cs: fixed properties order in returning collections
+       in PropertyDescriptorCollection
+
 2007-12-25  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * PropertyDescriptorCollection.cs: optimized Find method, removed

Modified: trunk/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/TypeDescriptor.cs      
2008-01-03 16:12:03 UTC (rev 92186)
+++ trunk/mcs/class/System/System.ComponentModel/TypeDescriptor.cs      
2008-01-03 16:25:53 UTC (rev 92187)
@@ -1091,14 +1091,12 @@
                                return _properties;
                        
                        PropertyInfo[] props = InfoType.GetProperties 
(BindingFlags.Instance | BindingFlags.Public);
-                       Hashtable descs = new Hashtable ();
-                       for (int n= props.Length-1; n >= 0; n--)
+                       ArrayList descs = new ArrayList (props.Length);
+                       for (int n=0; n<props.Length; n++)
                                if (props [n].GetIndexParameters ().Length == 0)
-                                       descs[props[n].Name] = new 
ReflectionPropertyDescriptor (props[n]);
+                                       descs.Add (new 
ReflectionPropertyDescriptor (props[n]));
 
-                       PropertyDescriptor[] descriptors = new 
PropertyDescriptor[descs.Values.Count];
-                       descs.Values.CopyTo (descriptors, 0);
-                       _properties = new PropertyDescriptorCollection 
(descriptors, true);
+                       _properties = new PropertyDescriptorCollection 
((PropertyDescriptor[]) descs.ToArray (typeof (PropertyDescriptor)), true);
                        return _properties;
                }
        }

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

Reply via email to