public void Redo() { if (this.redoStack.Count > 0) { IUndoableCommand command = this.redoStack.Pop(); this.undoStack.Push(command); command.Redo(); } }
public void RedoLatest() { if (_redoStack.Count == 0) { return; } IUndoableCommand cmd = _redoStack.Pop(); cmd.Redo(); _undoStack.Push(cmd); }
/// <summary> /// Internal method for redoing 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 Redo( IUndoableCommand <TContext> command, TContext context) { // Establish our contracts. if (command == null) { throw new ArgumentNullException("command"); } // Execute the command and get its state. command.Redo(context); }
public void Redo() { if (!CanRedo) { return; } IUndoableCommand command = _redoStack[_redoStack.Count - 1]; _redoStack.RemoveAt(_redoStack.Count - 1); if (command != null) { command.Redo(); // Add to undo stack _undoStack.Add(command); } }