コード例 #1
0
        public void Undo()
        {
            IUndoRedoCommand command = _undoStack.Pop();

            _redoStack.Push(command);
            command.Unexecute();
            UpdateCommandStatus();
        }
コード例 #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);
         }
     }
 }