public void Undo() { if (_history.Count != 0) { IUndoableCommand command = _history.Pop(); command.Undo(); } }
public void Undo() { if ((commands.Count > 0) && (commands.Peek() is IUndoableCommand)) { IUndoableCommand command = (IUndoableCommand)commands.Pop(); command.Undo(); } }
public void Undo() { if (this.undoStack.Count > 0) { IUndoableCommand command = this.undoStack.Pop(); this.redoStack.Push(command); command.Undo(); } }
public void UndoLatest() { if (_undoStack.Count == 0) { return; } IUndoableCommand cmd = _undoStack.Pop(); cmd.Undo(); _redoStack.Push(cmd); }
/// <summary> /// Internal method for undoing a command with a specific context. /// </summary> /// <param name="command">The command to execute.</param> /// <param name="context">The context of the execution.</param> protected virtual void Undo( IUndoableCommand <TContext> command, TContext context) { // Establish our contracts. if (command == null) { throw new ArgumentNullException("command"); } // Execute the command and get its state. command.Undo(context); }
public void Undo() { if (!CanUndo) { return; } IUndoableCommand command = _undoStack[_undoStack.Count - 1]; _undoStack.RemoveAt(_undoStack.Count - 1); if (command != null) { command.Undo(); // Add to redo stack _redoStack.Add(command); } }
public void Undo() { IUndoableCommand lastCommand = _undoCommandStack.Pop(); lastCommand.Undo(); }
public void UndoButtonWasPushed() { undoCommand.Undo(); }