public void CreateUi() { var copyButton = new CopyButton(); copyButton.SetCommand(Execute(new CopyCommand(_activeEditor, this))); var cutButton = new CutButton(); cutButton.SetCommand(Execute(new CutCommand(_activeEditor, this))); var pasteButton = new PasteButton(); pasteButton.SetCommand(Execute(new PasteCommand(_activeEditor, this))); var undoButton = new UndoButton(); undoButton.SetCommand(Execute(new UndoCommand(_activeEditor, this))); }
private void RegisterCommands() { // bind the default commands to the buttons zoomInButton.SetCommand(Commands.IncreaseZoom, graphControl); zoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl); zoom100Button.SetCommand(Commands.Zoom, 1, graphControl); fitContentButton.SetCommand(Commands.FitContent, graphControl); undoButton.SetCommand(Commands.Undo, graphControl); redoButton.SetCommand(Commands.Redo, graphControl); GroupSelectionButton.SetCommand(Commands.GroupSelection, graphControl); UngroupSelectionButton.SetCommand(Commands.UngroupSelection, graphControl); CutButton.SetCommand(Commands.Cut, graphControl); copyButton.SetCommand(Commands.Copy, graphControl); PasteButton.SetCommand(Commands.Paste, graphControl); openButton.SetCommand(Commands.Open, graphControl); SaveButton.SetCommand(Commands.SaveAs, graphControl); DeleteButton.SetCommand(Commands.Delete, graphControl); }