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 **
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.