public class CliBindingContext
CliBindingContext | Initializes a new instance of the CliBindingContext class |
BinderMap | Map for looking up command binder delegates by definition classes, which are set by the source generator to be called from BindTDefinition(ParseResult, Boolean) method. |
CommandMap | Map for looking up definition classes by commands, which are set by the source generator to be called from IsCalledTDefinition(ParseResult) or ContainsTDefinition(ParseResult) methods. |
CreatorMap | Map for looking up instance creators by definition classes, which are set by the source generator to be called from BindTDefinition(ParseResult, Boolean) method. |
Bind(ParseResult, Type, Boolean) |
Creates a new instance of the command definition class and binds/populates the properties from the parse result.
Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result. If the command line input does not contain the indicated definition class (as self or as a parent), this method will return unless returnEmpty is set to , in that case it will return an empty instance with default property values. |
BindTDefinition(ParseResult, Boolean) |
Creates a new instance of the command definition class and binds/populates the properties from the parse result.
Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result. If the command line input does not contain the indicated definition class (as self or as a parent), this method will return unless returnEmpty is set to , in that case it will return an empty instance with default property values. |
BindAll |
Creates a new instance of the definition class for all contained commands (self and parents) and binds/populates the properties from the parse result.
Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result. |
BindCalled |
Creates a new instance of the definition class for called command and binds/populates the properties from the parse result.
Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result. |
Contains(ParseResult, Type) | Checks if the command line input contains the indicated definition class (as self or as a parent). |
ContainsTDefinition(ParseResult) | Checks if the command line input contains the indicated definition class (as self or as a parent). |
Create(Type) | Creates a new instance of the command definition class but without any binding. This is useful for example when you need to instantiate a definition class when using dependency injection. |
CreateTDefinition | Creates a new instance of the command definition class but without any binding. This is useful for example when you need to instantiate a definition class when using dependency injection. |
GetArgumentParserTArgument(FuncString, TArgument) |
Gets an argument parser method for an argument type.
This is mainly used for adding support for binding custom types which have a public constructor or a static Parse method with a string parameter (other parameters, if any, should be optional). |
GetArgumentParserTCollection, TItem(FuncArray, TCollection, FuncString, TItem) |
Gets an argument parser method for an argument type, if it's a collection type.
This is mainly used for adding support for all IEnumerableT compatible types which have a public constructor with a IEnumerableT or IListT parameter (other parameters, if any, should be optional). |
GetValue(ParseResult, Argument) |
Gets the parsed or default value for the specified argument.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValue(ParseResult, Directive) |
Gets the parsed or default value for the specified directive.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValue(ParseResult, Option) |
Gets the parsed or default value for the specified option.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValueT(ParseResult, Argument) | |
GetValueT(ParseResult, Directive) |
Gets the parsed or default value for the specified directive.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValueT(ParseResult, Option) | |
IsCalled(ParseResult, Type) | Checks if the command line input is for the indicated definition class. |
IsCalledTDefinition(ParseResult) | Checks if the command line input is for the indicated definition class. |