projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2007-05-08 Igor Zelmanovich <igorz@mainsoft.com>
[mono.git]
/
mcs
/
class
/
System
/
System.ComponentModel
/
TypeConverter.cs
diff --git
a/mcs/class/System/System.ComponentModel/TypeConverter.cs
b/mcs/class/System/System.ComponentModel/TypeConverter.cs
old mode 100755
(executable)
new mode 100644
(file)
index
1abb70f
..
f0e6050
--- a/
mcs/class/System/System.ComponentModel/TypeConverter.cs
+++ b/
mcs/class/System/System.ComponentModel/TypeConverter.cs
@@
-32,6
+32,7
@@
using System;
using System.Collections;
using System;
using System.Collections;
+using System.ComponentModel.Design.Serialization;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Globalization;
using System.Runtime.InteropServices;
@@
-47,6
+48,10
@@
namespace System.ComponentModel
public virtual bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
public virtual bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
+ if (sourceType == typeof (InstanceDescriptor)) {
+ return true;
+ }
+
return false;
}
return false;
}
@@
-67,6
+72,11
@@
namespace System.ComponentModel
public virtual object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
{
public virtual object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
{
+ 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() + "'");
}
throw new NotSupportedException (this.ToString() + " cannot be created from '" +
value.GetType().ToString() + "'");
}
@@
-181,7
+191,7
@@
namespace System.ComponentModel
public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
{
public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
{
- return GetProperties (context, value, n
ull
);
+ return GetProperties (context, value, n
ew Attribute[1] { BrowsableAttribute.Yes }
);
}
public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
}
public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
@@
-255,11
+265,19
@@
namespace System.ComponentModel
this.values = values;
}
this.values = values;
}
+ void ICollection.CopyTo (Array array, int index) {
+ CopyTo (array, index);
+ }
+
public void CopyTo (Array array, int index)
{
values.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 ();
public IEnumerator GetEnumerator ()
{
return values.GetEnumerator ();