public void AddAndDo(IUndoRedoCommand command) { undoBuffer.Push(command); redoBuffer.Clear(); Changed?.Invoke(this, null); command.Do(); }
public void Redo(int redoCount = 1) { for (int i = 1; i <= redoCount; i++) { if (redoBuffer.Count != 0) { IUndoRedoCommand command = redoBuffer.Pop(); command.Do(); undoBuffer.Push(command); } } Changed?.Invoke(this, null); }