开发者

Alias for EditorAttribute

Is there a way to create a shorter alias for an EditorAttribute? Instead of:

    [EditorAttribute(typeof<ColorPickerDialogPropertyValueEditor>, typeof<DialogPropertyValueEditor>)]
    public Color4 Color { get; set; }

I would like to write:

   开发者_运维百科 using ColorPicker = EditorAttribute(typeof<ColorPickerDialogPropertyValueEditor>, typeof<DialogPropertyValueEditor>)
    [ColorPicker]
    public Color4 Color { get; set; }

Unfortunately the EditorAttribute class is sealed so I cannot inherit it.


I see only one way:

using CPDPEditor = YourNamespace.ColorPickerDialogPropertyValueEditor;
using DPEditor = YourNamespace.DialogPropertyValueEditor;

...

[Editor(typeof(CPDPEditor), typeof(DPEditor))]

Or maybe the AttributeProvider will help you (dont know how)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜