Class AbstractCollectiveUndoCommand
Base class for implementing undo/redo commands.
Inheritance
Inherited Members
Namespace: Sdl.DesktopEditor.EditorApi.Implementation
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 |
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.
Properties
IsSource
Used in SideBySide editor to determine which control to use
Declaration
public bool IsSource { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
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.
Name
Name of the command (this may be displayed to users).
Declaration
public string Name { get; protected set; }
Property Value
Type | Description |
---|---|
String |
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.
Methods
Do()
Execute the command.
Declaration
public abstract void Do()
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.
Redo()
Re-execute the command. Default implementation calls Do().
Declaration
public virtual void Redo()
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.
Undo()
Un-execute the command.
Declaration
public abstract void Undo()
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.