Beispiel #1
0
        /// <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
            }
        }
Beispiel #2
0
 public void Undo()
 {
     if (CanUndo)
     {
         UndoRedoInProgress = true;
         undoRedoCompletion = new TaskCompletionSource <int>();
         try
         {
             stack.Rollback();
         }
         finally
         {
             undoRedoCompletion.SetResult(0);
             undoRedoCompletion = null;
             UndoRedoInProgress = false;
         }
     }
 }
Beispiel #3
0
 public void Undo()
 {
     UndoRedoInProgress = true;
     stack.Rollback();
     UndoRedoInProgress = false;
 }