UndoOption Enumeration


This enum controls how the undoable operation is treated on the undo stack.

Namespace:   Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

public enum UndoOption

Member nameDescription

Adds a new undo unit to the undo stack representing the changes that were made in the UndoableGraphTransactionScope.


Do not add any undo unit to the undo stack. This is useful for hidden operations on the GraphModel that the user does not see.


Try to merge the undo unit with any previous undo unit that has the same undoUnitId. If no matching undo unit is found, this unit is dropped.

This is useful for undo units that result from something asynchronous occurring after the "Add" item or "AddForce" has been added. For example, you might add a "MoveNode" unit UndoOption.Add, but then later as the mouse moves you send a series of UndoOption.Merge with the same "MoveNode" id as the Add operation so that all the move operations are rolled up into one atomic undo unit until mouse up is received.

Return to top