示例#1
0
        public void Redo()
        {
            if (redoStack.Count == 0)
            {
                return;
            }

            IUndoable <T> action = redoStack.Pop();
            T             obj    = action.Redo();

            if (ReferenceEquals(action, redoCleanAction))
            {
                fileIsClean.OnNext(Unit.Default);
            }

            affectedObject.OnNext(obj);
            AddUndoInternal(action);

            if (redoStack.Count == 0)
            {
                NotifyRedoUnavailable();
            }
            else
            {
                redoDescription.OnNext(redoStack.Peek().Description);
            }
        }
示例#2
0
 protected override void Execute()
 {
     if (_activeContent != null)
     {
         _activeContent.Redo();
     }
 }
示例#3
0
    public bool Redo()
    {
        bool result = redoStack.Count > 0;

        if (result)
        {
            IUndoable c = redoStack.Pop();
            undoStack.Push(c);
            c.Redo();
        }
        return(result);
    }
示例#4
0
        /// <summary>
        /// If possible, redo the top action on the redo stack.
        /// The action is moved onto the undo stack.
        /// If not possible, throws an InvalidOperationException
        /// </summary>
        public void Redo()
        {
            if (!CanRedo)
            {
                throw new InvalidOperationException();
            }

            IUndoable action = redos.Pop();

            action.Redo();
            undos.Push(action);

            if (savepoint.HasValue)
            {
                // it will now take one less redo to reach the savepoint
                savepoint--;
            }

            NotifyAllProps();
        }
示例#5
0
        /// <summary>
        /// 执行一次重复操作
        /// </summary>
        public void Redo(XUndoEventArgs args)
        {
            if (intPosition >= this.Count)
            {
                return;
            }
            bool back = bolLock;

            bolLock = true;
            try
            {
                intPosition++;
                IUndoable undo = this.Current;
                if (undo != null)
                {
                    undo.Redo(args);
                }
                OnStateChanged();
            }
            finally
            {
                bolLock = back;
            }
        }
示例#6
0
 public void Undo()
 {
     iud.Redo();
 }