コード例 #1
0
        /// <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
            }
        }
コード例 #2
0
ファイル: UndoRedoService.cs プロジェクト: Aggror/Stride
 public void Redo()
 {
     if (CanRedo)
     {
         UndoRedoInProgress = true;
         undoRedoCompletion = new TaskCompletionSource <int>();
         try
         {
             stack.Rollforward();
         }
         finally
         {
             undoRedoCompletion.SetResult(0);
             undoRedoCompletion = null;
             UndoRedoInProgress = false;
         }
     }
 }
コード例 #3
0
ファイル: UndoRedoService.cs プロジェクト: xubingyue/xenko
 public void Redo()
 {
     UndoRedoInProgress = true;
     stack.Rollforward();
     UndoRedoInProgress = false;
 }