How can you remove a single item from the Redo stack in the ArcGIS Pro SDK?

171
2
06-26-2019 09:22 AM
Highlighted
New Contributor III

This seems like it should be pretty simple, but I've been troubleshooting and can't seem to get it to work!

//I create an Edit operation

var splitFeatures = new EditOperation() { };


//Some Extra code goes here (https://github.com/TxDOT/Pro-LRS-Tools/blob/master/LRSTools/IdentifyRouteLocations.cs for full code) that splits and gets measures

splitFeatures.Split(lyr, oid, geometry);
splitFeatures.Execute();


//I Undo the Split

splitFeatures.UndoAsync();

//After I undo the edit operation, I want to remove the ability for the user to redo it.  How can I remove the single edit operation from the redostack?

var operationMgr = MapView.Active.Map.OperationManager;

//operationMgr.FindRedoOperations()

//RemoveRedoOperation();

I found this RemoveRedoOperation method, but I can't seem to find a good example of it in use.  Please help!

Thanks

JP

Reply
0 Kudos
2 Replies
Highlighted
New Contributor III

Narelle Chedzey‌ , I attended some of your Dev summit sessions about editing.  Do you have any insight into this issue?  Thanks!

Reply
0 Kudos
Highlighted
Esri Contributor

John, 

You're on the right track with the API methods you found.  Take a look at the Undo/Redo sample here 

https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/UndoRedo

Specifically the Remove Operation button on the dockpanel.   This illustrates how to remove from the undo stack.  Removing an operation from the redo stack will be the same - just substitute the methods to work with the redo stack.  

Narelle

Reply
0 Kudos