|
Group: Forum Members
Posts: 9,
Visits: 1
|
I may have found a way - might not be the easiest.
I've made a new class inheriting from NDiagramMainMenuBuilder and making up the list of commands from it from scratch, adding my own in where I need them, and removing ones where I don't want them.
Unfortunately, the base properties (FileCommandIds, EditCommandIds, etc) that return the command ids all throw an exception:
System.InvalidCastException was unhandled Message="At least one element in the source array could not be cast down to the destination array type." Source="mscorlib" StackTrace: at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable) at System.Collections.ArrayList.ToArray(Type type) at Nevron.Diagram.WinForm.Commands.NDiagramMainMenuBuilder.get_FileCommandIds()
For now, I've gone through all the values in the DiagramCommand enumeration and have overridden all of NDiagramMainMenuBuilder, as I needed to get these properties.
That said, if there's a better way to customize the menu than this, I'd love to hear it.
Thanks, Herb.
|