I\'m using a thir party code to manage undo/redo operations in a WindowsForm project.
I need to extend the Class to manage undo/redo operations in a Listview, this m
I see. It's a bit of how you define what a "Redo" should do. In your case you want to Redo an Undo operation. By default, a Redo repeats the last action. Even If you Undo something, the Redo Undos again. Try this approach: Understand the Code fragment only as building blocks. The "RemoveItem" Method don't add Code to Undo/Redo stack - Add this Undo Redo like in the Add - Method. If you don't need to 'Undo an Undo' - Operation, add a
Property IsDoingUndo as boolean
To UndoManager and set it true if doing an Undo. Check this Property in Add/Remove Method and don't add something to the Undo/Redo Stack. Like :
If not _UndoManager.IsDoingUndo then
...
else
...
endif
With this you will get control of what should be undo-able and redo-able. Sorry that I can not provide sourcecode this time.