public void EndAutoUndoCommands() { autoUndoCommands--; if (autoUndoCommands == 0) if (history.Count > 0) history.Peek().autoUndo = false; }