예제 #1
0
        /// <summary>
        /// do redo handle.
        /// </summary>
        public void Redo()
        {
            if (this.Redos.Count > 0)
            {
                UndoRedoCollection command = this.Redos.Pop();
                command.RedoChange();
                this.AddUndo(command);
            }

            if (this.Redos.Count > 0)
            {
                if (this.Redos.Peek().ChangedName == "Text Changes")
                {
                    this.RedoText = "Redo Text Changed";
                }
                else if (this.Redos.Peek().ChangedName == "Color Changes")
                {
                    this.RedoText = "Redo Color Changed";
                }

                this.CellPropertyChanged(this.Undos.Peek(), new PropertyChangedEventArgs("Redo"));
            }
            else
            {
                this.CellPropertyChanged(this.Undos.Peek(), new PropertyChangedEventArgs("Redo Cancel"));
            }
        }
예제 #2
0
        /// <summary>
        /// Add redo items in the stack redos.
        /// </summary>
        /// <param name="redo">redo items.</param>
        public void AddRedo(UndoRedoCollection redo)
        {
            this.Redos.Push(redo);
            if (redo.ChangedName == "Text Changes")
            {
                this.RedoText = "Redo Text Changed";
            }
            else if (redo.ChangedName == "Color Changes")
            {
                this.RedoText = "Redo Color Changed";
            }

            this.CellPropertyChanged(this.Undos, new PropertyChangedEventArgs("Redo"));
        }