Type parameters:
| T | Type constraint. |
Constructors
UndoList
#public UndoList(T initial)
Create a new undo/redo list.
Parameters:
| initial (T) | Initial current state. |
Properties
Current
#public T Current { get; set; }
Gets or sets the current state. When set, the redo list will be cleared and the current "current" state will be pushing onto the undo stack.
Methods
Clear
#Erase undo and/or redo records. Only call this overload if you know what you are doing. Typically you always want to clear *both* buffers at the same time.
FirstRedoRecord
#Gets the first redo record, if any.
Parameters:
| record (out T) | First record. |
Returns: True if there was a record.
FirstUndoRecord
#Gets the first undo record, if any.
Parameters:
| record (out T) | First record. |
Returns: True if there was a record.
PerformRedo
#Perform a single redo step. This will move a the current state onto the undo stack and pop the most recent redo record into the current state.
Returns: Redo record.
PerformUndo
#Perform a single undo step. This will move the current state onto the redo stack and pop the most recent undo record into the current state.
Returns: True if an undo was performed.
SetCurrentQuietly
#public void SetCurrentQuietly(T state)
Set the current state without affecting the undo and redo stacks. Use this method if you wish to update the current state without recording an undo record.
Parameters:
| state (T) |