Ejemplo n.º 1
0
        public void Undo()
        {
            IUndoRedoCommand command = _undoStack.Pop();

            _redoStack.Push(command);
            command.Unexecute();
            UpdateCommandStatus();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Отменяет предыдущую команду.
 /// </summary>
 public void Undo()
 {
     if (CanUndo)
     {
         IUndoRedoCommand command = (IUndoRedoCommand)_executedCommandList[_currentCommandIndex];
         try
         {
             command.Unexecute();
             _currentCommandIndex--;
         }
         catch (Exception ex)
         {
             throw;// new Exception(string.Format("Command {0} have not unexecuted", command.Name), ex);
         }
     }
 }