public void UndoPreviousCommand()
        {
            IReversibleCommand cmd = null;

            if (this.undoCommandStack.TryPeek(out cmd))
            {
                cmd.Undo();

                this.undoCommandStack.TryPop(out cmd);
            }
        }
Exemplo n.º 2
0
        public void Undo()
        {
            if (undoList.Count == 0)
            {
                return;
            }

            IReversibleCommand reversibleCommand = undoList.First.Value;

            undoList.RemoveFirst();
            reversibleCommand.Undo();
            redoList.AddFirst(reversibleCommand);
        }