If I have a class like the following whose code I cannot change, how can I add an EditorAttribute to s1
at run-time?
class TestClass
{
public String s1 {get;set;}
public String s2 {get;set;}
}
I tried this method, but it adds an EditorAttribute editor to s2
too and I don't want that.
TypeDescriptor.AddAttributes(
typeof(String),
new EditorAttribute (
typeof(MyUITypeEditor),
typeof(UITypeEditor)));
How can I do this?