|
|
@@ -265,10 +265,10 @@ public sealed class TypeDescriptor
|
|
|
return new ArrayConverter ();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (t == null)
|
|
|
- t = FindConverterType (type);
|
|
|
-
|
|
|
+
|
|
|
+ if (t == null)
|
|
|
+ t = FindConverterType (type);
|
|
|
+
|
|
|
if (t != null) {
|
|
|
Exception exc = null;
|
|
|
try {
|
|
|
@@ -285,29 +285,29 @@ public sealed class TypeDescriptor
|
|
|
}
|
|
|
|
|
|
return new ReferenceConverter (type); // Default?
|
|
|
- }
|
|
|
-
|
|
|
- private static Type FindConverterType (Type type)
|
|
|
- {
|
|
|
- Type t = null;
|
|
|
-
|
|
|
- // Is there a default converter
|
|
|
- t = (Type) DefaultConverters [type];
|
|
|
- if (t != null)
|
|
|
- return t;
|
|
|
-
|
|
|
- // Find default converter with a type this type is assignable to
|
|
|
- foreach (Type defType in DefaultConverters.Keys) {
|
|
|
- if (defType.IsInterface && defType.IsAssignableFrom (type)) {
|
|
|
- return (Type) DefaultConverters [defType];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // Nothing found, try the same with our base type
|
|
|
- if (type.BaseType != null)
|
|
|
- return FindConverterType (type.BaseType);
|
|
|
- else
|
|
|
- return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Type FindConverterType (Type type)
|
|
|
+ {
|
|
|
+ Type t = null;
|
|
|
+
|
|
|
+ // Is there a default converter
|
|
|
+ t = (Type) DefaultConverters [type];
|
|
|
+ if (t != null)
|
|
|
+ return t;
|
|
|
+
|
|
|
+ // Find default converter with a type this type is assignable to
|
|
|
+ foreach (Type defType in DefaultConverters.Keys) {
|
|
|
+ if (defType.IsInterface && defType.IsAssignableFrom (type)) {
|
|
|
+ return (Type) DefaultConverters [defType];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Nothing found, try the same with our base type
|
|
|
+ if (type.BaseType != null)
|
|
|
+ return FindConverterType (type.BaseType);
|
|
|
+ else
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
public static EventDescriptor GetDefaultEvent (Type componentType)
|