Click or drag to resize
CommandTState Class
Command class which performs a command on a given object. What is performed is set by a lambda expression. State is contained inside this object. This is a typical implementation of the Command pattern, with undo/redo capabilities. See: http://en.wikipedia.org/wiki/Command_pattern
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.CommandsCommandBase
    SD.Tools.Algorithmia.CommandsCommandTState
      SD.Tools.Algorithmia.CommandsUndoablePeriodCommand

Namespace:  SD.Tools.Algorithmia.Commands
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.2.0.0 (1.2.16.0406)
Syntax
public class Command<TState> : CommandBase

Type Parameters

TState
The type of the state preserved inside the command.

The CommandTState type exposes the following members.

Constructors
  NameDescription
Public methodCommandTState(Action)
Initializes a new instance of the CommandTState class.
Public methodCommandTState(Action, Action)
Initializes a new instance of the CommandTState class.
Public methodCommandTState(Action, Action, String)
Initializes a new instance of the CommandTState class.
Public methodCommandTState(Action, FuncTState, ActionTState)
Initializes a new instance of the CommandTState class.
Public methodCommandTState(Action, FuncTState, ActionTState, String)
Initializes a new instance of the CommandTState class.
Top
Properties
  NameDescription
Public propertyAfterDoAction
Gets or sets the after Do action, which is an action executed right after Do has been called on this command
(Inherited from CommandBase.)
Public propertyAfterUndoAction
Gets or sets the after Undo action, which is an action executed right after Undo has been called on this command
(Inherited from CommandBase.)
Public propertyBeforeDoAction
Gets or sets the before Do action, which is an action executed right before Do is called on this command
(Inherited from CommandBase.)
Public propertyBeforeUndoAction
Gets or sets the before Undo action, which is an action executed right before Undo is called on this command
(Inherited from CommandBase.)
Public propertyDescription
Gets or sets the description of the command. This description can be used to show the commands in a queue visually on a screen.
(Inherited from CommandBase.)
Public propertyOwnCommandQueue
Gets the own command queue of this command. This queue is then used to store commands which are spawned when this command is executed.
(Inherited from CommandBase.)
Top
Methods
  NameDescription
Protected methodDo
Executes the command.
(Overrides CommandBaseDo.)
Public methodStatic memberDoNow(Action)
Enqueues and runs a new command by passing the function specified. Use this shortcut to wrap several statements into a single undo block.
Public methodStatic memberDoNow(Action, Action)
Enqueues and runs a new command by passing the function specified. Use this shortcut to wrap several statements into a single undo block.
Public methodStatic memberDoNow(Action, Action, String)
Enqueues and runs a new command by passing the function specified. Use this shortcut to wrap several statements into a single undo block.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodRedo
Re-executes the command. Normally this is simply calling 'Do', however in an undoable period redo it's calling PerformRedo.
(Inherited from CommandBase.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUndo (Overrides CommandBaseUndo.)
Top
See Also