Пример #1
0
 protected virtual void OnBeforeExecute(BeforeExecuteEventArgs e)
 {
     if(BeforeExecute != null)
     BeforeExecute(this, e);
 }
Пример #2
0
 public void Execute(ICommand command)
 {
     BeforeExecuteEventArgs args = new BeforeExecuteEventArgs() { Cancel = false, Command = command };
       OnBeforeExecute(args);
       if(!args.Cancel)
       {
     command.Execute();
     if(command is IUndoableCommand)
     {
       commandHistory.Push((IUndoableCommand)command);
       undoneCommands.Clear();
       OnCommandHistoryChanged();
     }
       }
 }