Skip to main content

Interface ICommandService

Service responsible for subscribing and unsubscribing to Meadow commands.

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface ICommandService

Methods

Subscribe(Action<MeadowCommand>)

Subscribes an action to handle a generic Meadow command.

View Source
Declaration
void Subscribe(Action<MeadowCommand> action)
Parameters
TypeNameDescription
System.Action<Meadow.Cloud.MeadowCommand>actionThe action to perform when any Meadow command is received.

Subscribe<T>(Action<T>)

Subscribes an action to handle a Meadow command of type T.

View Source
Declaration
void Subscribe<T>(Action<T> action) where T : IMeadowCommand, new()
Parameters
TypeNameDescription
System.Action<<T>>actionThe action to perform when a Meadow command with a command name that matches
the name of type T is received.
Type Parameters
NameDescription
TType of the meadow command.

Unsubscribe<T>()

Unsubscribes an action that handles a Meadow command of type T.

View Source
Declaration
void Unsubscribe<T>() where T : IMeadowCommand, new()
Type Parameters
NameDescription
TType of the meadow command.

Unsubscribe()

Unsubscribes an action to handle a generic Meadow command.

View Source
Declaration
void Unsubscribe()