virtualSoC  0.6.2
baskett
DotArgs.CollectionArgument Class Reference

An option that can take multiple values. More...

+ Inheritance diagram for DotArgs.CollectionArgument:

Public Member Functions

 CollectionArgument (bool required=false)
 Initializes a new instance of the CollectionArgument class. More...
 
override object GetValue ()
 Gets the value of this argument. More...
 
override void Reset ()
 Resets this argument. More...
 
override void SetValue (object value)
 Sets the value for this argument. More...
 
 CollectionArgument (bool required=false)
 Initializes a new instance of the CollectionArgument class. More...
 
override object GetValue ()
 Gets the value of this argument. More...
 
override void Reset ()
 Resets this argument. More...
 
override void SetValue (object value)
 Sets the value for this argument. More...
 
 CollectionArgument (bool required=false)
 Initializes a new instance of the CollectionArgument class. More...
 
override object GetValue ()
 Gets the value of this argument. More...
 
override void Reset ()
 Resets this argument. More...
 
override void SetValue (object value)
 Sets the value for this argument. More...
 

Properties

object DefaultValue [get, set]
 The default value that will be used if no value was passed on the command line. More...
 
string HelpMessage [get, set]
 The message that will be displayed in the help page for your program. More...
 
string HelpPlaceholder [get, set]
 Value that will be shown (in upper case) in the usage page for this argument. Setting this to null will display the default value (i.e. OPTION, COLLECTION, etc.). More...
 
bool IsRequired [get, protected set]
 Flag indicating whether this argument is required, i.e. must be provided via the command line. More...
 
bool NeedsValue [get, protected set]
 Indicates whether this argument requires an explicit option. More...
 
Action< object > Processor [get, set]
 A method that can be executed when the command line arguments are processed. More...
 
bool SupportsMultipleValues [get, protected set]
 Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one. More...
 
Func< object, bool > Validator [get, set]
 A method that can be used to validate a value for this argument. More...
 

Detailed Description

An option that can take multiple values.

Constructor & Destructor Documentation

◆ CollectionArgument() [1/3]

DotArgs.CollectionArgument.CollectionArgument ( bool  required = false)

Initializes a new instance of the CollectionArgument class.

Parameters
requiredFlag indicating whether this argument is required.
173  : base( null, required )
174  {
175  SupportsMultipleValues = true;
176  HelpPlaceholder = "COLLECTION";
177  base.SetValue( new string[0] );
178  }
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143
bool SupportsMultipleValues
Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one...
Definition: CommandLineArgs.cs:159

◆ CollectionArgument() [2/3]

DotArgs.CollectionArgument.CollectionArgument ( bool  required = false)

Initializes a new instance of the CollectionArgument class.

Parameters
requiredFlag indicating whether this argument is required.
173  : base( null, required )
174  {
175  SupportsMultipleValues = true;
176  HelpPlaceholder = "COLLECTION";
177  base.SetValue( new string[0] );
178  }
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143
bool SupportsMultipleValues
Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one...
Definition: CommandLineArgs.cs:159

◆ CollectionArgument() [3/3]

DotArgs.CollectionArgument.CollectionArgument ( bool  required = false)

Initializes a new instance of the CollectionArgument class.

Parameters
requiredFlag indicating whether this argument is required.
173  : base( null, required )
174  {
175  SupportsMultipleValues = true;
176  HelpPlaceholder = "COLLECTION";
177  base.SetValue( new string[0] );
178  }
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143
bool SupportsMultipleValues
Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one...
Definition: CommandLineArgs.cs:159

Member Function Documentation

◆ GetValue() [1/3]

override object DotArgs.CollectionArgument.GetValue ( )
virtual

Gets the value of this argument.

Returns
The argument's value.

Reimplemented from DotArgs.Argument.

183  {
184  return Values.ToArray();
185  }

◆ GetValue() [2/3]

override object DotArgs.CollectionArgument.GetValue ( )
virtual

Gets the value of this argument.

Returns
The argument's value.

Reimplemented from DotArgs.Argument.

183  {
184  return Values.ToArray();
185  }

◆ GetValue() [3/3]

override object DotArgs.CollectionArgument.GetValue ( )
virtual

Gets the value of this argument.

Returns
The argument's value.

Reimplemented from DotArgs.Argument.

183  {
184  return Values.ToArray();
185  }

◆ Reset() [1/3]

override void DotArgs.CollectionArgument.Reset ( )
virtual

Resets this argument.

Reimplemented from DotArgs.Argument.

189  {
190  Values.Clear();
191  }

◆ Reset() [2/3]

override void DotArgs.CollectionArgument.Reset ( )
virtual

Resets this argument.

Reimplemented from DotArgs.Argument.

189  {
190  Values.Clear();
191  }

◆ Reset() [3/3]

override void DotArgs.CollectionArgument.Reset ( )
virtual

Resets this argument.

Reimplemented from DotArgs.Argument.

189  {
190  Values.Clear();
191  }

◆ SetValue() [1/3]

override void DotArgs.CollectionArgument.SetValue ( object  value)
virtual

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented from DotArgs.Argument.

196  {
197  Values.Add( value as string );
198  }

◆ SetValue() [2/3]

override void DotArgs.CollectionArgument.SetValue ( object  value)
virtual

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented from DotArgs.Argument.

196  {
197  Values.Add( value as string );
198  }

◆ SetValue() [3/3]

override void DotArgs.CollectionArgument.SetValue ( object  value)
virtual

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented from DotArgs.Argument.

196  {
197  Values.Add( value as string );
198  }

Property Documentation

◆ DefaultValue

object DotArgs.Argument.DefaultValue
getsetinherited

The default value that will be used if no value was passed on the command line.

Using this when IsRequired is set will have no effect.

◆ HelpMessage

string DotArgs.Argument.HelpMessage
getsetinherited

The message that will be displayed in the help page for your program.

◆ HelpPlaceholder

string DotArgs.Argument.HelpPlaceholder
getsetinherited

Value that will be shown (in upper case) in the usage page for this argument. Setting this to null will display the default value (i.e. OPTION, COLLECTION, etc.).

◆ IsRequired

bool DotArgs.Argument.IsRequired
getprotected setinherited

Flag indicating whether this argument is required, i.e. must be provided via the command line.

◆ NeedsValue

bool DotArgs.Argument.NeedsValue
getprotected setinherited

Indicates whether this argument requires an explicit option.

◆ Processor

Action< object > DotArgs.Argument.Processor
getsetinherited

A method that can be executed when the command line arguments are processed.

◆ SupportsMultipleValues

bool DotArgs.Argument.SupportsMultipleValues
getprotected setinherited

Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one.

◆ Validator

Func< object, bool > DotArgs.Argument.Validator
getsetinherited

A method that can be used to validate a value for this argument.


The documentation for this class was generated from the following file: