tags:

views:

26

answers:

1

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.

+1  A: 

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)

Nagg