C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Properties
ICommandManager Interface Reference

The ICommandManager interface provides methods to manage command handlers on the I/O and UI threads, and to configure command filters. Instance members are thread-safe. For more information, see CommandManager.

Public Functions

void AddIoHandler (string name, CommandHandler handler)
 
void AddUiHandler (string name, CommandHandler handler)
 
void InjectCommand (Guid sessionId, string type, IDictionary< string, object > parameters)
 
void RemoveIoHandler (string name)
 
void RemoveUiHandler (string name)
 

Properties

ICommandFilter CommandFilter [get, set]
 

Usage Description

void AddIoHandler ( string  name,
CommandHandler  handler 
)

Registers a handler with StateManager for the specified command name. The handler will be executed on the I/O thread.

Note
You can only have one handler for any given command. If you register two separate handlers for the same command, only the last one will be stored.

Parameters
nameThe name of the command that will fire the handler. The name that you use here when registering the handler will act as the command ID. This is the name that must be used in the client-side code when sending the command.
handlerThe handler function that will be executed when the command is received.

Implemented in CommandManager.

void AddUiHandler ( string  name,
CommandHandler  handler 
)

Registers a handler with StateManager for the specified command name. The handler will be executed on the UI thread.

Note
You can only have one handler for any given command. If you register two separate handlers for the same command, only the last one will be stored.

Parameters
nameThe name of the command that will fire the handler. The name that you use here when registering the handler will act as the command ID. This is the name that must be used in the client-side code when sending the command.
handlerThe handler function that will be executed when the command is received.

Implemented in CommandManager.

void InjectCommand ( Guid  sessionId,
string  type,
IDictionary< string, object >  parameters 
)

Simulates a command from a client. This method is typically used for testing purposes.

Parameters
sessionIdThe unique identifier of the session to which the command applies.
typeThe name of the command, as registered with StateManager.
parametersThe parameters that the client would have included in the command.

Implemented in CommandManager.

void RemoveIoHandler ( string  name)

Removes the handler for the specified command name from the I/O thread.

Parameters
nameThe name of the command for which the handler should be removed. This must be the same name as was used when the handler was first added using AddIoHandler.

Implemented in CommandManager.

void RemoveUiHandler ( string  name)

Removes the handler for the specified command name from the UI thread.

Parameters
nameThe name of the command for which the handler should be removed. This must be the same name as was used when the handler was first added using AddUiHandler.

Implemented in CommandManager.

Property Documentation

Gets or sets the command filter class currently used by the service; defaults to DefaultCommandFilter.