H
Harlan Messinger
I have a web control (call it X) that inherits from Panel and that has
the following member data and property:
private System.Collections.ArrayList items =
new System.Collections.ArrayList();
[Category("Behavior"),
Editor(typeof(XYZ.Harlan.Editors.CollectionEditor),
typeof(ComponentEditor))]
public System.Collections.ArrayList Items
{
get { return items; }
}
The Items will be a collection of objects of type NavBarItem.
I've defined the CollectionEditor class in namespace XYZ.Harlan.Editors,
inheriting it from
System.Windows.Forms.Design.WindowsFormsComponentEditor, and defining a
corresponding CollectionEditorPage, inherited from
System.Windows.Forms.Design.ComponentEditorPage
When I add an X control to a Web form, the Items properties shows up in
the property browser. Next to it, it reads "Collection", and it gives me
the "..." button to click to bring up an editor window. However, the
editor it's opening is the default "Object Collection Editor", just as
it does if I remove the Editor attribute from the definition of the
Items property.
What am I overlooking that is keeping my custom editor from being loaded?
Another question: if I wanted to use the default editor, how would I go
about it? Currently it thinks the item currently selected on the left is
nothing more than an Object, and only shows one property, Value, grayed
out on the right. How would I get it to treat an item as the NavBarItem
that it is, and show its properties, instead of as an Object? Or does it
not work this way?
the following member data and property:
private System.Collections.ArrayList items =
new System.Collections.ArrayList();
[Category("Behavior"),
Editor(typeof(XYZ.Harlan.Editors.CollectionEditor),
typeof(ComponentEditor))]
public System.Collections.ArrayList Items
{
get { return items; }
}
The Items will be a collection of objects of type NavBarItem.
I've defined the CollectionEditor class in namespace XYZ.Harlan.Editors,
inheriting it from
System.Windows.Forms.Design.WindowsFormsComponentEditor, and defining a
corresponding CollectionEditorPage, inherited from
System.Windows.Forms.Design.ComponentEditorPage
When I add an X control to a Web form, the Items properties shows up in
the property browser. Next to it, it reads "Collection", and it gives me
the "..." button to click to bring up an editor window. However, the
editor it's opening is the default "Object Collection Editor", just as
it does if I remove the Editor attribute from the definition of the
Items property.
What am I overlooking that is keeping my custom editor from being loaded?
Another question: if I wanted to use the default editor, how would I go
about it? Currently it thinks the item currently selected on the left is
nothing more than an Object, and only shows one property, Value, grayed
out on the right. How would I get it to treat an item as the NavBarItem
that it is, and show its properties, instead of as an Object? Or does it
not work this way?