Hola Hector,
no consegui mucha info, pero en la pagina de MS sobre la clase System.ComponentModel.Design.Serialization.InstanceDescriptor daba un poco de info:
escribi el ejemplo que daban con pequeñas modificaciones y funciono. Aca dejo el código por si alguien tiene el mismo problema:
Código PHP:
[TypeConverter(typeof(PlotLabConverter))]
public class MyScopeClass : Scope
{
internal class PlotLabConverter : TypeConverter
{
// This method overrides CanConvertTo from TypeConverter. This is called when someone
// wants to convert an instance of Triangle to another type. Here,
// only conversion to an InstanceDescriptor is supported.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(InstanceDescriptor))
{
return true;
}
// Always call the base to see if it can perform the conversion.
return base.CanConvertTo(context, destinationType);
}
// This code performs the actual conversion from a Triangle to an InstanceDescriptor.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(InstanceDescriptor))
{
ConstructorInfo ci = typeof(MyScopeClass).GetConstructor(new Type[]{});
return new InstanceDescriptor(ci, new object[]{});
}
// Always call base, even if you can't convert.
return base.ConvertTo(context, culture, value, destinationType);
}
}
}