The operation stack.
[Visual Basic .NET] Public ReadOnly Property OperationStack As IOperationStack
[C#] public IOperationStack OperationStack {get;}
Product Availability
Available with ArcGIS Desktop.
Remarks
The map document manages an operation stack which provides undo/redo functionality. Modifications, including those to elements and features, are typically wrapped inside an operation. Operations are added to the operation stack so the modification can be rolled out and then rolled back if desired. For example, when a graphic element is moved, the operation can be undone moving the graphic back to its original location.
Depending on your scenario, there are different methodologies for creating an operation and adding it to the OperationStack.
- If your tool edits features and rows, you can use IEditor::StartOperation, and IEditor::StopOperation and the actions in between will be automatically added to the OperationStack as a single operation. Stopping an edit session clears the OperationStack.
- If you are outside an editsession and updating a geodatabase directly, calls to IWorkspaceEdit::StartEditOperation and StopEditOperation will not automatically add anything to ArcMap’s OperationStack since these interfaces are independent of ArcMap, and these changes will be made directly to the geodatabase.
- For other actions, for example on graphic elements, you need to create a custom operation object that implements IOperation. The operation is executed and loaded onto the stack with a call to IOperationStack::Do.