Provides access to members that control the Operation Stack.
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Description
An application can implement an OperationStack to provide undo and redo facilities. As you carry out operations, they are added to the stack, then you can use undo and redo in the application to manipulate the stack to undo or redo the operations.
Members
Description | ||
---|---|---|
Count | The number of operations on the stack. | |
Do | Performs the given operation and places it on the stack. | |
Item | The operation at the specified index. | |
Redo | Redoes the next operation on the stack. | |
RedoOperation | Redoes a specified operation. | |
Remove | Removes an operation from the stack. | |
Reset | Removes all operations from the stack. | |
Undo | Undoes the previous operation on the stack. | |
UndoOperation | Undoes a specified operation. |
CoClasses that implement IOperationStack
CoClasses and Classes | Description |
---|---|
ControlsOperationStack | Use this class to provide operation support to the ToolbarControl. |
Remarks
ArcMap has an OperationStack, which can be obtained with the IMxDocument::OperationStack property. ArcMap’s buttons and tools wrap their actions in an operation and add the operations to the stack.
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.