views:

27

answers:

1

Hi,

I've had a long look through MSDN documentation and all I'm starting to think that this editor is defined as Internal only. I'm guessing it is similar to the CollectionEditor, though this does provide any ToolStripItem specific elements.

[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]

Does anyone know the class for this editor - the one which ToolStrip.Items uses?

+1  A: 

Looks like it is System.Windows.Forms.Design.ToolStripCollectionEditor internal class from the System.Design assembly:

[Editor("System.Windows.Forms.Design.ToolStripCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public class ToolStripItemCollection : ArrangedElementCollection, IList, ICollection, IEnumerable
{
...
}
DevExpress Team
Thanks very much! I'm guessing its internal state means I cannot use it on a Property...
Tony Day
I think you should try :) You cannot directly instantiate (or derive from) this internal class in you code, but .NET Framework itself can do it.
DevExpress Team
When I open the editor I get an error message ("Value cannot be null. Parameter name: value") and the editor does not open. The collection wouldn't be null because it references an existing ToolStrip. Have you come across this message before? Thanks
Tony Day
Got same message. Debugged and looked at the code causing an exception with Reflector. Unfortunately ToolStripCollectionEditor explicitly assumes that only ToolStrip should be the owner of property with ToolStripItemCollection type. It seems there is no good workaround.
DevExpress Team
Thanks for you time :)
Tony Day
@Tony, you should use reflector to decompile the editor then create your editor based on it.
Ian Ringrose