Hi Trudy,
The diagram command bars manager will automatically update the Enabled state of the UI command that is used as a visual front end of a certain NDiagramCommand, such as the NOpenDrawingCommand. That is why you cannot simply disable the UI command itself, because the diagram command bars manager will reset it to result of the underlying NDiagramCommand after a certain period of time. You can however override the NOpenDrawingCommand implementation like this:
...
NDiagramCommand cmd = manager.Commander.Commands.GetCommandFromId((int)DiagramCommand.OpenDrawing);
int index = manager.Commander.Commands.IndexOf(cmd);
manager.Commander.Commands.RemoveAt(index);
manager.Commander.Commands.Insert(index, new NMyOpenDrawingCommand());
...
public class NMyOpenDrawingCommand : NOpenDrawingCommand
{
public override bool Enabled
{
get
{
return false;
}
}
}
Best Regards,
Nevron Support Team