public void UndoPreviousCommand() { IReversibleCommand cmd = null; if (this.undoCommandStack.TryPeek(out cmd)) { cmd.Undo(); this.undoCommandStack.TryPop(out cmd); } }
public void Undo() { if (undoList.Count == 0) { return; } IReversibleCommand reversibleCommand = undoList.First.Value; undoList.RemoveFirst(); reversibleCommand.Undo(); redoList.AddFirst(reversibleCommand); }