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