CliCommandBuilderGetArgumentParserTCollection, TItem(FuncArray, TCollection, FuncString, TItem) Method
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).
Namespace: DotMake.CommandLineAssembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 1.8.8
public static Func<ArgumentResult, TCollection> GetArgumentParser<TCollection, TItem>(
Func<Array, TCollection> convertFromArray,
Func<string, TItem> convertFromString = null
)
- convertFromArray FuncArray, TCollection
- A delegate which creates an instance of collection type from an array.
- convertFromString FuncString, TItem (Optional)
- A delegate which creates an instance of item type from a string.
- TCollection
- The collection type, the argument type itself.
- TItem
- The item type, e.g. if argument type is IEnumerable<T>, item type will be T.
FuncArgumentResult,
TCollectionA delegate which can be passed to an option or argument.