Hi Uli,
First you will need to change the value of the second parameter in the CreateChanelCommand constructor from (int)8888 to (int)DiagramCommand.LastCommandId + 1
You will also need to create your custom toolbars builder class similar to the following:
public class MyNDiagramToolBarsBuilder : NDiagramToolbarsBuilder
{
public override NDockingToolbar[] BuildToolbars()
{
ArrayList toolbars = new ArrayList(base.BuildToolbars());
int commandId = (int)DiagramCommand.LastCommandId + 1;
NCommand command = CreateCommand(commandId, false);
for (int i = 0; i < toolbars.Count; i++)
{
NToolbar toolbar = toolbars[i] as NToolbar;
if(toolbars == null)
{
continue;
}
if (toolbar.Text == "Tools")
{
toolbar.Commands.Add(command);
}
}
return (NDockingToolbar[])toolbars.ToArray(typeof(NDockingToolbar));
}
public override void Reset()
{
base.Reset();
customCommandIds = new ArrayList();
customCommandIds.Add((int)DiagramCommand.LastCommandId + 1);
}
private ArrayList customCommandIds;
}
Then you will need to set an instance of the class above to NDiagramCommandBarsManager.ToolbarsBuilder property.
I hope this helps.