Class CommandManager
Command manager
Inherited Members
Namespace: PayrollEngine.Client.Command
Assembly: PayrollEngine.Client.Core.dll
Syntax
public class CommandManager
Constructors
CommandManager(ICommandConsole, ILogger)
Command manager
Declaration
public CommandManager(ICommandConsole console, ILogger logger = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ICommandConsole | console | |
| ILogger | logger |
Properties
HasCommands
Test for any command
Declaration
public bool HasCommands { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
ExecuteAsync(ICommand, PayrollHttpClient)
Execute specific command using the environment command line arguments
Declaration
public Task<int> ExecuteAsync(ICommand command, PayrollHttpClient httpClient = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ICommand | command | |
| PayrollHttpClient | httpClient |
Returns
| Type | Description |
|---|---|
| Task<int> | Exit code |
ExecuteAsync(PayrollHttpClient)
Execute command using the environment command line arguments
Declaration
public Task<int> ExecuteAsync(PayrollHttpClient httpClient = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PayrollHttpClient | httpClient |
Returns
| Type | Description |
|---|---|
| Task<int> | Exit code |
GetCommand(string)
Get command by name
Declaration
public ICommand GetCommand(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Command name |
Returns
| Type | Description |
|---|---|
| ICommand |
GetCommandLineCommand()
Get command line command
Declaration
public ICommand GetCommandLineCommand()
Returns
| Type | Description |
|---|---|
| ICommand |
GetCommands()
List of available commands
Declaration
public List<ICommand> GetCommands()
Returns
| Type | Description |
|---|---|
| List<ICommand> |
RegisterAssembly(Assembly)
Register assembly commands
Declaration
public void RegisterAssembly(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | Source assembly |