Gorgon
Show / Hide Table of Contents

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 Source

Description

Property to return the description of the aceiont to undo/redo.

Declaration
string Description { get; }
Property Value
Type Description
string
| Edit this page View Source

IsExecuting

Property to return whether or not the undo operation is executing.

Declaration
bool IsExecuting { get; }
Property Value
Type Description
bool
| Edit this page View Source

Service

Property to return the service that owns this command.

Declaration
IUndoService Service { get; }
Property Value
Type Description
IUndoService

Methods

| Edit this page View Source

Redo(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.

| Edit this page View Source

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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author