/* * Action batching so undo/redo affect a group of actions. Call StartBatch, BatchPerform..., and end with EndBatch */ public void StartBatch() { batch = new ActionBatch(); if (!Level.Changed) { batch.LevelWasChanged = false; Level.Changed = true; } while (UndoStack.Count >= Properties.Settings.Default.UndoLimit) UndoStack.RemoveFirst(); UndoStack.AddLast(batch); RedoStack.Clear(); }
public void EndBatch() { batch = null; }