documentationfor yFiles for HTML 3.0.0.3

IUndoUnit

Represents a unit of work that can be undone and redone.

Inheritance Hierarchy
IUndoUnit

Remarks

Clients should use this interface when certain actions, changes, or events should be monitored and have undoability provided for them. If you simply want to track the state of certain items between two states of interest, you should consider using mementos instead.

The central methods of this interface are undo and redo which contain the logic to undo or redo a unit of work. Keep in mind that undo/redo are sensible operations and should maintain a consistent state before and after each operation since they may be executed potentially often one after another.

The requirement for an IUndoUnit is that when a program is in a certain state and a call to undo is followed by a call to redo then the program is in the exact same state as before (the same holds true for the other way around).

IUndoUnits are managed by the UndoEngine. Custom units can always be added to the engine using the method addUnit. Also consider using fromHandler to take delegates for the undo/redo operations and combine to create a bracketing unit comprising several other units.

Also note that in order to keep a consistent state, methods of objects of this type should not be called by client code directly but only through UndoEngine instead.

Type Details

yFiles module
view

Properties

Methods

Static Methods