Class CommandHandlerActor
Convenience class for creating actors who handle Commands sent from a Petabridge.Cmd client.
Inherited Members
Namespace: Petabridge.Cmd.Host
Assembly: Petabridge.Cmd.Host.dll
Syntax
public abstract class CommandHandlerActor : ReceiveActor, IInternalActor, IInitializableActor
Constructors
CommandHandlerActor(CommandPalette)
Declaration
protected CommandHandlerActor(CommandPalette commands)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandPalette | commands |
Fields
Commands
The set of commands supported by this actor
Declaration
protected readonly CommandPalette Commands
Field Value
| Type | Description |
|---|---|
| CommandPalette |
Validator
Declaration
protected readonly CommandValidator Validator
Field Value
| Type | Description |
|---|---|
| CommandValidator |
Methods
DoNothing(Command)
Declaration
protected static void DoNothing(Command c)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | c |
ExecuteCommand(Command, Action<Command, ParsedArguments>)
Declaration
protected void ExecuteCommand(Command command, Action<Command, ParsedArguments> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | |
| Action<Command, ParsedArguments> | handler |
ExecuteCommand(Command, Action<Command>)
Declaration
protected void ExecuteCommand(Command command, Action<Command> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | |
| Action<Command> | handler |
Process(string, Action<Command, ParsedArguments>)
Handles a Command with the provided name and handler. Executes command validation and fault-checking automatically.
Declaration
protected void Process(string commandName, Action<Command, ParsedArguments> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| string | commandName | The name of the Command that will be processed. |
| Action<Command, ParsedArguments> | handler | The handler for processing this command, provided that the Command is valid. |
Process(string, Action<Command>)
Handles a Command with the provided name and handler. Executes command validation and fault-checking automatically.
Declaration
protected void Process(string commandName, Action<Command> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| string | commandName | The name of the Command that will be processed. |
| Action<Command> | handler | The handler for processing this command, provided that the Command is valid. |