/// <summary> /// Navigates backward in the selection history. /// </summary> public void NavigateBackward() { // 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.CanRollback && (initialState.Equals(CurrentState) || !CurrentState.HasValidSelection())) { stack.Rollback(); // Skip transactions that don't have effect anymore } }
public void Undo() { if (CanUndo) { UndoRedoInProgress = true; undoRedoCompletion = new TaskCompletionSource <int>(); try { stack.Rollback(); } finally { undoRedoCompletion.SetResult(0); undoRedoCompletion = null; UndoRedoInProgress = false; } } }
public void Undo() { UndoRedoInProgress = true; stack.Rollback(); UndoRedoInProgress = false; }