Helper class for managing undo/redo operations in the drawing manager. Callers apply a change first and then record the action with ExecuteAction; the action's Execute/Undo methods are used when replaying history.

Members

MemberKindDescription
int MaxHistoryDepthPropertyGets or sets the maximum number of undo steps retained. 0 means unlimited.
bool IsApplyingHistoryPropertyGets a value indicating whether an undo/redo replay is currently in progress. While replaying, nested history recording is suppressed to protect the stacks.
bool CanUndoPropertyGets a value indicating whether undo is available.
bool CanRedoPropertyGets a value indicating whether redo is available.
event EventHandler HistoryChangedEventOccurs when the undo/redo state changes.
HistoryManager(DrawingManager drawingManager)MethodInitializes a new instance of the HistoryManager class. The drawing manager that owns this history manager.
void ExecuteAction(DrawingAction action)MethodRecords an already-applied action on the undo stack. The action to record.
void Undo()MethodUndoes the last action.
void Redo()MethodRedoes the last undone action.
void Clear()MethodClears the undo/redo history.
int UndoCountPropertyGets the number of actions that can be undone.
int RedoCountPropertyGets the number of actions that can be redone.

Related