Class CommandLineApplication<TModel>
Describes a set of command line arguments, options, and execution behavior
using a type of TModel
to model the application.
Inherited Members
Namespace: McMaster.Extensions.CommandLineUtils
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public class CommandLineApplication<TModel> : CommandLineApplication, IServiceProvider, IDisposable, IModelAccessor where TModel : class
Type Parameters
Name | Description |
---|---|
TModel |
Constructors
| Improve this Doc View SourceCommandLineApplication()
Initializes a new instance of CommandLineApplication<TModel>.
Declaration
public CommandLineApplication()
CommandLineApplication(IHelpTextGenerator, IConsole, String)
This constructor is obsolete and will be removed in a future version. The recommended replacement is CommandLineApplication(IHelpTextGenerator, IConsole, String)
Initializes a new instance of CommandLineApplication<TModel>.
Declaration
public CommandLineApplication(IHelpTextGenerator helpTextGenerator, IConsole console, string workingDirectory)
Parameters
Type | Name | Description |
---|---|---|
IHelpTextGenerator | helpTextGenerator | The help text generator to use. |
IConsole | console | The console implementation to use. |
System.String | workingDirectory | The current working directory. |
CommandLineApplication(IConsole)
Initializes a new instance of CommandLineApplication<TModel>.
Declaration
public CommandLineApplication(IConsole console)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console implementation to use. |
CommandLineApplication(IConsole, String)
Initializes a new instance of CommandLineApplication<TModel>.
Declaration
public CommandLineApplication(IConsole console, string workingDirectory)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console implementation to use. |
System.String | workingDirectory | The current working directory. |
Properties
| Improve this Doc View SourceModel
An instance of the model associated with the command line application.
Declaration
public TModel Model { get; }
Property Value
Type | Description |
---|---|
TModel |
ModelFactory
Defines the function that produces an instance of TModel
.
Declaration
public Func<TModel> ModelFactory { get; set; }
Property Value
Type | Description |
---|---|
System.Func<TModel> |
Methods
| Improve this Doc View SourceCreateModel()
Create an instance of TModel
.
Declaration
protected virtual TModel CreateModel()
Returns
Type | Description |
---|---|
TModel | An instance of the context. |
Dispose()
Declaration
public override void Dispose()
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIModelAccessor.GetModel()
Declaration
object IModelAccessor.GetModel()
Returns
Type | Description |
---|---|
System.Object |
IModelAccessor.GetModelType()
Declaration
Type IModelAccessor.GetModelType()
Returns
Type | Description |
---|---|
System.Type |