private void RefreshCommandEnabled() { FileSaveCommand.RefreshEnabled(); FileSaveAsCommand.RefreshEnabled(); EditCutCommand.RefreshEnabled(); EditCopyCommand.RefreshEnabled(); EditPasteCommand.RefreshEnabled(); EditDeleteCommand.RefreshEnabled(); }
private void InitializeCommands() { FileNewCircuitCommand = new FileNewCircuitCommand(this); BindMenuItem(newToolStripMenuItem, FileNewCircuitCommand); FileOpenCircuitCommand = new FileOpenCircuitCommand(this); BindMenuItem(openToolStripMenuItem, FileOpenCircuitCommand); FileSaveCommand = new FileSaveCommand(this); BindMenuItem(saveToolStripMenuItem, FileSaveCommand); FileSaveAsCommand = new FileSaveAsCommand(this); BindMenuItem(saveAsToolStripMenuItem, FileSaveAsCommand); FileExitCommand = new FileExitCommand(); BindMenuItem(exitToolStripMenuItem, FileExitCommand); EditCutCommand = new EditCutCommand(this); BindMenuItem(cutToolStripMenuItem, EditCutCommand); EditCopyCommand = new EditCopyCommand(this); BindMenuItem(copyToolStripMenuItem, EditCopyCommand); EditPasteCommand = new EditPasteCommand(this); BindMenuItem(pasteToolStripMenuItem, EditPasteCommand); EditDeleteCommand = new EditDeleteCommand(this); BindMenuItem(deleteToolStripMenuItem, EditDeleteCommand); ToolsOptionsCommand = new ToolsOptionsCommand(this); BindMenuItem(optionsToolStripMenuItem, ToolsOptionsCommand); HelpAboutCommand = new HelpAboutCommand(this); BindMenuItem(aboutToolStripMenuItem, HelpAboutCommand); MdiChildActivate += (sender, args) => RefreshCommandEnabled(); }