public void Undo() { IUndoRedoCommand command = _undoStack.Pop(); _redoStack.Push(command); command.Unexecute(); UpdateCommandStatus(); }
/// <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); } } }