Interface IUndoService
The service used to supply undo/redo functionality.
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IUndoService
Properties
| Edit this page View SourceCanRedo
Property to return whether or not the service can redo.
Declaration
bool CanRedo { get; }
Property Value
Type | Description |
---|---|
bool |
CanUndo
Property to return whether or not the service can undo.
Declaration
bool CanUndo { get; }
Property Value
Type | Description |
---|---|
bool |
UndoItems
Property to return the undo items in the undo stack.
Declaration
IEnumerable<string> UndoItems { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Methods
| Edit this page View SourceCancel()
Function to cancel the currently executing undo/redo operation.
Declaration
void Cancel()
ClearStack()
Function to clear the undo/redo stacks.
Declaration
void ClearStack()
Record<TU, TR>(string, Func<TU, CancellationToken, Task>, Func<TR, CancellationToken, Task>, TU, TR)
Function to record an undo/redo state.
Declaration
void Record<TU, TR>(string desc, Func<TU, CancellationToken, Task> undoAction, Func<TR, CancellationToken, Task> redoAction, TU undoArgs, TR redoArgs) where TU : class where TR : class
Parameters
Type | Name | Description |
---|---|---|
string | desc | The description of the action being recorded. |
Func<TU, CancellationToken, Task> | undoAction | The action to execute when undoing. |
Func<TR, CancellationToken, Task> | redoAction | The action to execute when redoing. |
TU | undoArgs | The parameters to pass to the undo operation. |
TR | redoArgs | The parameters to pass to the redo oprtation. |
Type Parameters
Name | Description |
---|---|
TU | The type of undo parameters to pass. Must be a reference type. |
TR | The type of redo parameters to pass. Must be a reference type. |
Remarks
This method will do nothing if an undo or redo operation is executing.
Redo()
Function to perform a redo operation.
Declaration
Task Redo()
Returns
Type | Description |
---|---|
Task | A task representing the currently executing redo operation. |
Undo()
Function to perform an undo operation.
Declaration
Task Undo()
Returns
Type | Description |
---|---|
Task | A task representing the currently executing undo operation. |