Exemple #1
0
 private async Task ExecuteCommand(IAppCommand cmd)
 {
     if (await cmd.CanExecute(Arguments.ToArray()))
     {
         await cmd.Execute(Arguments.ToArray());
     }
 }
 public void AddCommand(IAppCommand command, bool execute = true)
 {
     if(execute)
         command.Execute();
     _undoList.Add(command);
     _redoList.Clear();
     if(UndoLevel > 0 && _undoList.Count > UndoLevel)
         _undoList.RemoveAt(0);
     UpdateChanges();
 }
 public void AddCommand(IAppCommand command, bool execute = true)
 {
     if (execute)
     {
         command.Execute();
     }
     _undoList.Add(command);
     _redoList.Clear();
     if (UndoLevel > 0 && _undoList.Count > UndoLevel)
     {
         _undoList.RemoveAt(0);
     }
     UpdateChanges();
 }