My EditorAttribute is ignored
Hello,
I've got a weird problem with my code. I've created an UITypeEditor:
Code:
public class ColorPickerEditor : UITypeEditor {...}
and use it properly:
Code:
[Editor(typeof(TypeEditor.ColorPickerEditor), typeof(System.Drawing.Design.UITypeEditor))]
public System.Drawing.Color TestColorDrawing { get; set; }
[Editor(typeof(TypeEditor.ColorPickerEditor), typeof(System.Drawing.Design.UITypeEditor))]
public Vector4 TestColorV4D { get; set; }
The Editor for the Vector4 works perfectly. The problem is for the other one. If I put a breakpoint in my class, my ColorPickerEditor is never called(instanciated) for the System.Drawing.Color. It seems that the default ColorConverter is used instead of my override.
Anyone has a workaround or ideas?
Re: My EditorAttribute is ignored
I would try this:
Code:
[Editor(typeof(TypeEditor.ColorPickerEditor), typeof(System.Drawing.Design.ColorEditor))]
public System.Drawing.Color TestColorDrawing { get; set; }
Re: My EditorAttribute is ignored
ColorEditor doesn't exist. I've did some seach, but it seems that only TypeConverter exist for the type Color. And if we read the doc about the ctor of the EditorAttribute:
Quote:
Originally Posted by msdn
Summary:
Initializes a new instance of the System.ComponentModel.EditorAttribute class with the type and the base type.
Parameters:
type: A System.Type that represents the type of the editor.
baseType: The System.Type of the base class or interface to use as a lookup key for the editor. This class must be or derive from System.Drawing.Design.UITypeEditor.
we cannot put a TypeConverter as the second parameter.
Re: My EditorAttribute is ignored
It is strange. The class exists. But I've not try it.
Re: My EditorAttribute is ignored
Looks like I made a mistake with my search, and I didn't have the reference "System.Drawing.Design". But after trying your idea, it doesn't change anything to the problem. I've also tried to inherit from it, but same conclusion.
Re: My EditorAttribute is ignored
Sorry, I've no futher advice at this time :(