Skip to main content

Parameter

A class in Root.Township, Alta.Console.

One parameter of a console Command, built from the method's ParameterInfo.

Constructors​

MemberWhat it is
Parameter(ParameterInfo parameterInfo, Command command, string description)Creates a Parameter from parameterInfo, command and description.

Properties​

MemberWhat it is
Command Command { get; }The command this parameter belongs to.
object Default { get; }The default value. If the method's default is null this holds the string "default" instead.
bool HasDefault { get; }Whether the parameter has a default value, so it can be left out.
ParameterInfo ParameterInfo { get; }Reflection info for the method parameter.
string ParsingError { get; set; }Why the last value given for this parameter couldn't be parsed. Shown when a command fails to match.
Type Type { get; }The parameter's type.

Methods​

MemberWhat it is
string ToListString()Formats the parameter as a list line with name, type and default, for help output.
override string ToString()Formats the parameter as [name (Type)], with its default when it has one.

Used in​

Members of other types that take, return or hold a Parameter: