Exemplo n.º 1
0
        /// <summary>
        /// Redoes the last undone operation.
        /// </summary>
        public void Redo()
        {
            AssertNoUndoGroupOpen();
            if (InternalRedoStack.Count > 0)
            {
                IUndoableOperation operation = InternalRedoStack.DequeueHead();
                InternalUndoStack.EnqueueHead(operation);
                operation.Do();
                OnOperationRedone();

                if (InternalRedoStack.Count == 0)
                {
                    OnPropertyChanged(new PropertyChangedEventArgs("CanRedo"));
                }

                if (InternalUndoStack.Count == 1)
                {
                    OnPropertyChanged(new PropertyChangedEventArgs("CanUndo"));
                }

                EnforceSizeLimit();
            }
        }