Description
The Insert
method is used to add a new undo/redo entry to the UndoSystem
. This method allows you to specify the actions that should be taken when an undo or redo operation is performed. Each entry is identified by a title, which can be used to describe the action being undone or redone.
Usage
To use the Insert
method, provide a descriptive title for the undo/redo action, along with the corresponding undo
and redo
actions. These actions are defined as System.Action
delegates, which encapsulate the logic to be executed during the undo or redo process.
Example usage:
UndoSystem undoSystem = new UndoSystem();
undoSystem.Insert(
"Move Object",
() => { /* Logic to undo the move */ },
() => { /* Logic to redo the move */ }
);
Example
UndoSystem undoSystem = new UndoSystem();
undoSystem.Insert(
"Move Object",
() => { /* Logic to undo the move */ },
() => { /* Logic to redo the move */ }
);