Table of Contents

Class CommandCatalog

Namespace
Signal.Application.Commands
Assembly
Signal.Application.dll

Registration-time list of command sources, populated by the DI builder (AddCommands, AddCommand, AddCommandModule, MapCommand) and consumed once by ICommandRegistry. Registered in DI as a singleton instance.

public sealed class CommandCatalog
Inheritance
CommandCatalog
Inherited Members

Properties

CommandTypes

Registered ICommand implementations (must also be registered in DI).

public IReadOnlyList<Type> CommandTypes { get; }

Property Value

IReadOnlyList<Type>

Descriptors

Directly registered descriptors (e.g. delegate commands).

public IReadOnlyList<CommandDescriptor> Descriptors { get; }

Property Value

IReadOnlyList<CommandDescriptor>

ModuleTypes

Registered CommandModule types.

public IReadOnlyList<Type> ModuleTypes { get; }

Property Value

IReadOnlyList<Type>

ReactionModuleTypes

Registered ReactionModule types.

public IReadOnlyList<Type> ReactionModuleTypes { get; }

Property Value

IReadOnlyList<Type>

Methods

Add(CommandDescriptor)

Adds a ready-made descriptor.

public void Add(CommandDescriptor descriptor)

Parameters

descriptor CommandDescriptor

The descriptor.

AddCommand(Type)

Adds a class-based command type. Duplicates are ignored.

public void AddCommand(Type commandType)

Parameters

commandType Type

A non-abstract ICommand implementation.

Exceptions

ArgumentException

The type is not a non-abstract ICommand.

AddModule(Type)

Adds a command module type. Duplicates are ignored.

public void AddModule(Type moduleType)

Parameters

moduleType Type

A non-abstract CommandModule.

Exceptions

ArgumentException

The type is not a non-abstract CommandModule.

AddReactionModule(Type)

Adds a reaction module type (its OnReactionAttribute methods). Duplicates are ignored.

public void AddReactionModule(Type moduleType)

Parameters

moduleType Type

A non-abstract ReactionModule.

Exceptions

ArgumentException

The type is not a non-abstract ReactionModule.

InvalidOperationException

A handler has an unsupported parameter or return type (checked now, not on the first reaction).