Description
The OnUndo
field is an event handler that is triggered whenever an undo operation is executed within the UndoSystem
. This field is of type System.Action<Sandbox.Helpers.UndoSystem.Entry>
, allowing you to attach custom logic that should be executed when an undo action occurs.
Usage
To use the OnUndo
field, you can subscribe to it with a method that matches the signature of System.Action<Sandbox.Helpers.UndoSystem.Entry>
. This method will be called with the Entry
object that represents the undo action being performed.
Example usage:
UndoSystem undoSystem = new UndoSystem();
undoSystem.OnUndo += entry => {
// Custom logic to execute when an undo is performed
Console.WriteLine($"Undo action: {entry.Title}");
};
Example
UndoSystem undoSystem = new UndoSystem();
undoSystem.OnUndo += entry => {
// Custom logic to execute when an undo is performed
Console.WriteLine($"Undo action: {entry.Title}");
};