Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Feature: Support for ICustomTypeProvider [22045]

$
0
0
I think ICustomTypeProvider is newer and easier to use than ICustomTypeDescriptor.

I suggest to add its support by adding a single condition as show here:

ObjectContainerHelperBase.cs

protected static List<PropertyDescriptor> GetPropertyDescriptors(object instance)
{
PropertyDescriptorCollection descriptors;

TypeConverter tc = TypeDescriptor.GetConverter(instance);
if (tc == null || !tc.GetPropertiesSupported())
{
if (instance is ICustomTypeDescriptor)
{
descriptors = ((ICustomTypeDescriptor)instance).GetProperties();
}
else if (instance is ICustomTypeProvider)
{
descriptors = TypeDescriptor.GetProperties(((ICustomTypeProvider)instance).GetCustomType());
}
else
{
descriptors = TypeDescriptor.GetProperties(instance.GetType());
}
}
else
{
descriptors = tc.GetProperties(instance);
}

return (descriptors != null)
? descriptors.Cast<PropertyDescriptor>().ToList()
: null;
}
Comments: ** Comment from web user: BoucherS **

Hi,

This will be fixed in v2.9.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>