Class CommandsServiceCollectionExtensions
Dependency Injection extensions for HostedCommandsService.
Inheritance
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Wolfringo.Hosting.dll
Syntax
public static class CommandsServiceCollectionExtensions
Methods
| Improve this Doc View SourceAddArgumentBlockMarker(IHostedCommandsServiceBuilder, Char, Char)
Adds argument marker to Arguments Parser.
Declaration
public static IHostedCommandsServiceBuilder AddArgumentBlockMarker(this IHostedCommandsServiceBuilder builder, char startMarker, char endMarker)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Char | startMarker | Opening marker for argument block. |
System.Char | endMarker | Closing marker for argument block. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceAddHandler<T>(IHostedCommandsServiceBuilder)
Adds handler to Command Service.
Declaration
public static IHostedCommandsServiceBuilder AddHandler<T>(this IHostedCommandsServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
Type Parameters
Name | Description |
---|---|
T | Type of handler to add. |
See Also
AddHandlers(IHostedCommandsServiceBuilder, Assembly[])
Adds handlers to Command Service.
Declaration
public static IHostedCommandsServiceBuilder AddHandlers(this IHostedCommandsServiceBuilder builder, params Assembly[] assemblies)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Reflection.Assembly[] | assemblies | Assemblies to load handlers from. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
AddHandlers(IHostedCommandsServiceBuilder, Type[])
Adds handlers to Command Service.
Declaration
public static IHostedCommandsServiceBuilder AddHandlers(this IHostedCommandsServiceBuilder builder, params Type[] handlerTypes)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Type[] | handlerTypes | Types of handlers to add. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
AddWolfringoCommands(IServiceCollection, Action<CommandsOptions>)
Adds Wolfringo Commands System.
Declaration
public static IHostedCommandsServiceBuilder AddWolfringoCommands(this IServiceCollection services, Action<CommandsOptions> configure = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Service collection. |
System.Action<CommandsOptions> | configure | Alters configuration of Command Service. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
EnableDefaultHelpCommand(IHostedCommandsServiceBuilder)
Enables default help command.
Declaration
public static IHostedCommandsServiceBuilder EnableDefaultHelpCommand(this IHostedCommandsServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
MapArgumentConverter(IHostedCommandsServiceBuilder, Type, IArgumentConverter)
Maps an argument converter in Argument Converter Provider.
Declaration
public static IHostedCommandsServiceBuilder MapArgumentConverter(this IHostedCommandsServiceBuilder builder, Type parameterType, IArgumentConverter converter)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Type | parameterType | Type of parameter to set converter for. |
IArgumentConverter | converter | Converter to convert type with. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceMapCommandInitializer(IHostedCommandsServiceBuilder, Type, ICommandInitializer)
Maps command initializer for a command attribute type in Command Initializer Provider.
Declaration
public static IHostedCommandsServiceBuilder MapCommandInitializer(this IHostedCommandsServiceBuilder builder, Type commandArgumentType, ICommandInitializer initializer)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Type | commandArgumentType | Type of command attribute. |
ICommandInitializer | initializer | Initializer to use for given command attribute type. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceRemoveArgumentBlockMarker(IHostedCommandsServiceBuilder, Char)
Removes argument marker from Arguments Parser.
Declaration
public static IHostedCommandsServiceBuilder RemoveArgumentBlockMarker(this IHostedCommandsServiceBuilder builder, char startMarker)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Char | startMarker | Opening marker for argument block. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceRemoveDefaultHandlers(IHostedCommandsServiceBuilder)
Removes all default assemblies and classes from Commands Options.
Declaration
public static IHostedCommandsServiceBuilder RemoveDefaultHandlers(this IHostedCommandsServiceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetArgumentBaseMarker(IHostedCommandsServiceBuilder, Char)
Sets base argument marker for Arguments Parser.
Declaration
public static IHostedCommandsServiceBuilder SetArgumentBaseMarker(this IHostedCommandsServiceBuilder builder, char marker)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Char | marker | Marker for to use as base. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetCaseSensitive(IHostedCommandsServiceBuilder, Boolean)
Sets case sensitivity.
Declaration
public static IHostedCommandsServiceBuilder SetCaseSensitive(this IHostedCommandsServiceBuilder builder, bool caseSensitive)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.Boolean | caseSensitive | Whether commands should be case sensitive. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetEnumArgumentConverter(IHostedCommandsServiceBuilder, IArgumentConverter)
Sets a fallback enum argument converter in Argument Converter Provider.
Declaration
public static IHostedCommandsServiceBuilder SetEnumArgumentConverter(this IHostedCommandsServiceBuilder builder, IArgumentConverter converter)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
IArgumentConverter | converter | Converter to convert enums with. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetPrefix(IHostedCommandsServiceBuilder, String)
Sets prefix.
Declaration
public static IHostedCommandsServiceBuilder SetPrefix(this IHostedCommandsServiceBuilder builder, string prefix)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.String | prefix | Prefix value. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetPrefix(IHostedCommandsServiceBuilder, String, PrefixRequirement)
Sets prefix and prefix requirement.
Declaration
public static IHostedCommandsServiceBuilder SetPrefix(this IHostedCommandsServiceBuilder builder, string prefix, PrefixRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
System.String | prefix | Prefix value. |
PrefixRequirement | requirement | Prefix requirement. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |
See Also
| Improve this Doc View SourceSetPrefixRequirement(IHostedCommandsServiceBuilder, PrefixRequirement)
Sets prefix requirement.
Declaration
public static IHostedCommandsServiceBuilder SetPrefixRequirement(this IHostedCommandsServiceBuilder builder, PrefixRequirement requirement)
Parameters
Type | Name | Description |
---|---|---|
IHostedCommandsServiceBuilder | builder | Hosted Commands Service builder. |
PrefixRequirement | requirement | Prefix requirement. |
Returns
Type | Description |
---|---|
IHostedCommandsServiceBuilder |