public void Redo(int numberOfRedos = 1) { for (int i = 0; i < numberOfRedos; i++) { var command = stack.Redo(); if (command == null) { throw new ApplicationException(); } command.Execute(); RaiseOperationExecuted(command, ExecutionOperation.Redo); } }
public void Redo(int numberOfRedos = 1) { for (int i = 0; i < numberOfRedos; i++) { var command = stack.Redo(); if (command == null) { throw new ApplicationException(); } command.Execute(); RaiseOperationExecuted(command, CommandOperation.Redo); if (stack.RedoItems().Count > 0 && stack.RedoItems().First().isImplicit) { i--; // Do not increase redo counter if next command is implicit } } }
public RedoButton(IUndoRedoStack undoRedoStack, string description, string image, bool isEnabled) : base(new Command(() => { undoRedoStack.Redo(); }), description, image, isEnabled);