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