2007-05-08 Igor Zelmanovich <igorz@mainsoft.com>
[mono.git] / mcs / class / System / System.ComponentModel / TypeConverter.cs
index 18dc749e8ebc291b0e757d8972b77dd091a63793..f0e605098f11c9261465dbafa167e75d029d2df2 100644 (file)
@@ -75,7 +75,8 @@ namespace System.ComponentModel
                        if (value is InstanceDescriptor) {
                                return ((InstanceDescriptor) value).Invoke ();
                        }
-
+                       if (value == null)
+                               throw new NotSupportedException ("Cannot convert from null");
                        throw new NotSupportedException (this.ToString() + " cannot be created from '" +
                                                         value.GetType().ToString() + "'");
                }
@@ -190,7 +191,7 @@ namespace System.ComponentModel
 
                public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
                {
-                       return GetProperties (context, value, null);
+                       return GetProperties (context, value, new Attribute[1] { BrowsableAttribute.Yes });
                }
 
                public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
@@ -264,11 +265,19 @@ namespace System.ComponentModel
                                this.values = values;
                        }
 
+                       void ICollection.CopyTo (Array array, int index) {
+                               CopyTo (array, index);
+                       }
+
                        public void CopyTo (Array array, int index)
                        {
                                values.CopyTo (array, index);
                        }
 
+                       IEnumerator IEnumerable.GetEnumerator () {
+                               return GetEnumerator ();
+                       }
+
                        public IEnumerator GetEnumerator ()
                        {
                                return values.GetEnumerator ();