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

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

    Parameters

    category
    The category of operations to clear.
    Example
    Dockpane undo / redo
    {
      // in order to find a dockpane you need to know its DAML id
      pane = FrameworkApplication.DockPaneManager.Find(dockPaneID);
    
      // get the undo stack
      OperationManager manager = pane.OperationManager;
      if (manager != null)
      {
        // undo an operation
        // Use await with UndoAsync and RedoAsync
        if (manager.CanUndo)
          manager.UndoAsync().Wait();
    
        // redo an operation
        if (manager.CanRedo)
          manager.RedoAsync().Wait();
    
        // 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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also