Class AbstractCollectiveUndoCommand
Base class for implementing undo/redo commands.
Inherited Members
Namespace: SdlSdl.DesktopEditorEditorApiImplementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public abstract class AbstractCollectiveUndoCommand : ICollectiveUndoCommand, IUndoCommand
Remarks
Provides default implementations for the Name property and the Redo() method. Derived classes should at a minimum provide implementations of Do() and Undo().
Implementations need to keep in mind that the behavior of Redo must consistently be the same as Do, and Undo must completely reverse the actions of Do and Redo. This means that the command must track its own state correctly and adhere to the command pattern.
Constructors
AbstractCollectiveUndoCommand(string)
Construction from a command name.
Declaration
protected AbstractCollectiveUndoCommand(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Properties
IsSource
Used in SideBySide editor to determine which control to use
Declaration
public bool IsSource { get; set; }
Property Value
Type | Description |
---|---|
bool |
Name
Name of the command (this may be displayed to users).
Declaration
public string Name { get; protected set; }
Property Value
Type | Description |
---|---|
string |
Methods
Do()
Execute the command.
Declaration
public abstract void Do()
Redo()
Re-execute the command. Default implementation calls Do().
Declaration
public virtual void Redo()
Undo()
Un-execute the command.
Declaration
public abstract void Undo()