public void Redo() { if (historyStacks.Count > 0) { UndoableCommand command = historyStacks.Pop() as UndoableCommand; commandStacks.Push(command); command.execute(); } }
public void Undo() { if (commandStacks.Count > 0) { UndoableCommand command = commandStacks.Pop() as UndoableCommand; historyStacks.Push(command); command.Undo(); } }