/// <summary> /// Navigates forward in the selection history. /// </summary> public void NextSelection() { // Should hardly happen, but let's ignore this action if we're still terminating a selection if (currentTransaction != null) { return; } var initialState = CurrentState; while (stack.CanRollforward && (initialState.Equals(CurrentState) || !CurrentState.HasValidSelection())) { stack.Rollforward(); // Skip transactions that don't have effect anymore } }
public void Redo() { if (CanRedo) { UndoRedoInProgress = true; undoRedoCompletion = new TaskCompletionSource <int>(); try { stack.Rollforward(); } finally { undoRedoCompletion.SetResult(0); undoRedoCompletion = null; UndoRedoInProgress = false; } } }
public void Redo() { UndoRedoInProgress = true; stack.Rollforward(); UndoRedoInProgress = false; }