How To Combine Different Actions Into One Atomic Action To Avoid the Undo Operation On Certain Actions

29 Feb 20161 minute to read

This is done by calling the Model.HistoryManger.StartAtomicAction(string description) / EndAtomicAction() methods.

The actions can be recorded into the history manager such that the undo and redo operations can be performed. The recording can be controlled and the undo and redo actions can be performed using the following tools.

  • StartAtomicAction-This tool, when called, stops recording the actions and hence will not be added to the undo history manager.
  • EndAtomicAction-This tool cancels the StartAtomicAction process and turns on the recording of actions in the history manager.
this.diagram1.Model.HistoryManager.StartAtomicAction("Custom Action");

Me.diagram1.Model.HistoryManager.StartAtomicAction("Custom Action")