ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework Namespace / OperationManager Class / ClearUndoCategory Method
The category of operations to clear.
Example

In This Topic
    ClearUndoCategory Method
    In This Topic
    Removes all operations belonging to the specified category from undo stack.
    Syntax
    public void ClearUndoCategory( 
       string category
    )
    Public Sub ClearUndoCategory( _
       ByVal category As String _
    ) 

    Parameters

    category
    The category of operations to clear.
    Example
    Dockpane undo / redo
    // in order to find a dockpane you need to know it's DAML id
    var pane = FrameworkApplication.DockPaneManager.Find("esri_core_contentsDockPane");
    
    // get the undo stack
    OperationManager manager = pane.OperationManager;
    if (manager != null)
    {
      // undo an operation
      if (manager.CanUndo)
        await manager.UndoAsync();
    
      // redo an operation
      if (manager.CanRedo)
        await manager.RedoAsync();
    
      // clear the undo and redo stack of operations of a particular category
      manager.ClearUndoCategory("Some category");
      manager.ClearRedoCategory("Some category");
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also