Class CommandLineApplication<TModel>
- Namespace
- McMaster.Extensions.CommandLineUtils
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
Describes a set of command line arguments, options, and execution behavior
using a type of TModel to model the application.
public class CommandLineApplication<TModel> : CommandLineApplication, IServiceProvider, IDisposable, IModelAccessor where TModel : class
Type Parameters
TModel
- Inheritance
-
objectCommandLineApplication<TModel>
- Implements
- Inherited Members
- Extension Methods
Constructors
CommandLineApplication()
Initializes a new instance of CommandLineApplication<TModel>.
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>.
public CommandLineApplication(IHelpTextGenerator helpTextGenerator, IConsole console, string workingDirectory)
Parameters
helpTextGeneratorIHelpTextGeneratorThe help text generator to use.
consoleIConsoleThe console implementation to use.
workingDirectorystringThe current working directory.
CommandLineApplication(IConsole)
Initializes a new instance of CommandLineApplication<TModel>.
public CommandLineApplication(IConsole console)
Parameters
consoleIConsoleThe console implementation to use.
CommandLineApplication(IConsole, string)
Initializes a new instance of CommandLineApplication<TModel>.
public CommandLineApplication(IConsole console, string workingDirectory)
Parameters
consoleIConsoleThe console implementation to use.
workingDirectorystringThe current working directory.
Properties
Model
An instance of the model associated with the command line application.
public TModel Model { get; }
Property Value
- TModel
ModelFactory
Defines the function that produces an instance of TModel.
public Func<TModel> ModelFactory { get; set; }
Property Value
- Func<TModel>
Methods
CreateModel()
Create an instance of TModel.
protected virtual TModel CreateModel()
Returns
- TModel
An instance of the context.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()