【发布时间】:2014-10-24 08:05:17
【问题描述】:
出于好奇,想象一下你有这样一个 UITypeEditor:
public class CustomEditor : System.Drawing.Design.UITypeEditor
{
public bool DoSomething { get; set; }
[...]
}
并且您想使用它来编辑您的属性之一,并将DoSomething 设置为true:
public MyClass
{
[EditorAttribute(typeof(CustomEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string MyProperty { get; set; }
[...]
}
如何在实例化编辑器时为CustomEditor 的DoSomething 属性指定一个值?
这是否可能,还是您必须创建与可能配置数量一样多的继承CustomEditor 的类?
【问题讨论】:
标签: c# .net uitypeeditor