1
コードを変更できない次のようなクラスがある場合、実行時にEditorAttributeをs1
にどのように追加できますか?実行時に(動的に)オブジェクトの特別なプロパティにEditorAttributeを追加する
class TestClass
{
public String s1 {get;set;}
public String s2 {get;set;}
}
私はこの方法を試してみましたが、それはあまりにもs2
にEditorAttributeエディタを追加し、私はそれを望んでいません。
TypeDescriptor.AddAttributes(
typeof(String),
new EditorAttribute (
typeof(MyUITypeEditor),
typeof(UITypeEditor)));
どうすればいいですか?