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)
精彩评论