Example #1
0
 public void ExecuteCommand(UndoableCommand command)
 {
     command.Execute();
     this.ExecuteCommandCalled   = true;
     this.ExecuteCommandArgument = command;
     this.ExecuteCommandNumberOfCalls++;
 }
Example #2
0
        private bool Execute(UndoableCommand command)
        {
            if (!command.CanExecute(this))
            {
                return(false);
            }
            bool success = false;

            try { success = command.Execute(this); }
            catch (Exception ex) { ShowErrorMessage(ex.Message); }
            if (success)
            {
                undoManager.Add(command);
                RaiseStateChanged();
            }
            return(true);
        }