public static ICustomTypeDescriptor GetCustomTypeDescriptor(Type t, object instance) { if (instance is ICustomTypeDescriptor ictd) { return(ictd); } else { ICustomTypeDescriptor result = new MyTypeDescriptionProvider(t).GetTypeDescriptor(t, instance); return(result); } }
public static ICustomTypeDescriptor GetCustomTypeDescriptor(Type t) { ICustomTypeDescriptor result = new MyTypeDescriptionProvider(t).GetTypeDescriptor(t); return(result); }