Class AbstractCollectiveUndoCommand
Base class for implementing undo/redo commands.
Inheritance
System.Object
AbstractCollectiveUndoCommand
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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 |
---|---|---|
System.String | name |
Properties
IsSource
Used in SideBySide editor to determine which control to use
Declaration
public bool IsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Name of the command (this may be displayed to users).
Declaration
public string Name { get; protected set; }
Property Value
Type | Description |
---|---|
System.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()