Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
 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);
 }