Interface IUndoCommand
A command used to perform an undo (or redo) action that will store commands (and associated data) to reset state or the opposite.
Namespace: Gorgon.Editor.UI
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IUndoCommand
Remarks
When developing a UI for a content plug in, there will come a time when the user of the content editor will make a mistake. To handle this the undo command interface is used to record steps that will reverse the operation, and, optionally, restore it.
This type is used internally by the IUndoService to store state, and does not typically need to be implemented by the developer.
Properties
| Edit this page View SourceDescription
Property to return the description of the aceiont to undo/redo.
Declaration
string Description { get; }
Property Value
Type | Description |
---|---|
string |
IsExecuting
Property to return whether or not the undo operation is executing.
Declaration
bool IsExecuting { get; }
Property Value
Type | Description |
---|---|
bool |
Service
Property to return the service that owns this command.
Declaration
IUndoService Service { get; }
Property Value
Type | Description |
---|---|
IUndoService |
Methods
| Edit this page View SourceRedo(CancellationToken)
Function to redo the changes that were previously undone.
Declaration
Task Redo(CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancelToken | A cancellation token for canceling the operation. |
Returns
Type | Description |
---|---|
Task | A the task representing the executing redo operation. |
Undo(CancellationToken)
Function to undo the changes performed by this command.
Declaration
Task Undo(CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancelToken | A cancellation token for canceling the operation. |
Returns
Type | Description |
---|---|
Task | A the task representing the executing undo operation. |