コード例 #1
0
 public void Redo()
 {
     if (CanRedo == false)
     {
         return;
     }
     UndoList.Push(_value);
     _value = RedoList.Pop();
     OnPropertyChanged("Value");
     OnPropertyChanged("CanUndo");
     OnPropertyChanged("CanRedo");
 }
コード例 #2
0
        public bool Redo()
        {
            if (RedoSize == 0)
            {
                return(false);
            }

            var action = RedoList.Pop();

            action.PerformAction();
            UndoList.Push(action);
            return(true);
        }
コード例 #3
0
        /// <summary>
        /// Performs a redo action.
        /// </summary>
        /// <returns>
        /// Returns true if the redo action succeeds; otherwise, returns false.
        /// </returns>
        public bool Redo()
        {
            bool flag = true;

            if (AllowUndo && CanRedo)
            {
                ICommand command = RedoList.Peek();
                try
                {
                    command.Execute(Context);
                }
                catch
                {
                    flag = false;
                }
                if (flag)
                {
                    UndoList.Push(RedoList.Pop());
                    RaiseChanged(UndoRedoOperation.Redo, command.ToString());
                }
            }
            return(flag);
        }