public void Execute() { StackedCommand undoneCommand = GetUndoneCommand(); undoneCommand.UnExecute(); if (UndoExecuted != null) { UndoExecuted(undoneCommand); } Controller.InvokeExecutedCommand(undoneCommand, false, null, true, false); }
public void Execute() { StackedCommand redoneCommand = GetRedoneCommand(); redoneCommand.ExecuteAsRedo(); if (RedoExecuted != null) { RedoExecuted(redoneCommand); } Controller.InvokeExecutedCommand(redoneCommand, false, null, false, true); }
private StackedCommand GetUndoneCommand() { StackedCommand topStackedCommandModel = Controller.UndoStack.Empty ? null : Controller.UndoStack.Peek(); StackedCommand undoneCommand; if (topStackedCommandModel != null) { undoneCommand = topStackedCommandModel; } else { throw new InvalidOperationException(CommandErrors.CMDERR_STACK_INCONSISTENT); } return(undoneCommand); }