StauffConsulting.Essentials.

Switch

C#: 
public abstract class Switch :
    object

VB: 
Public MustInherit Class Switch
    Inherits Object

Type Ancestry:  Object
+---Switch
Derived Types:  SimpleSwitch HelpSwitch StringSwitch IntSwitch DecimalSwitch DateTimeSwitch StringListSwitch IntListSwitch EnumSwitchBase


Abstract base for all switches. For use with CmdLineParser.

Summary Info

Constructor Summary

Switch Constructor.

Field Summary

protectedstring _help
static
readonly
ArrayList AllSwitches Whenever a switch is instantiated, it is added to this list.
bool Found Tells whether the switch was found in the command line.
readonlystring Name The name of the switch, including the initial hyphen.
readonlystring NameLC The name of the switch in lower case.
readonlybool Required Is this switch required?
readonlystring ValueHelp Describes the type of value expected by the switch (if any).

Property Summary

string Help Help for the switch.

Method Summary

Parse Tries to parse the next thing from the argument list. This is for internal use only by CmdLineParser.
WriteHelp Displays help for the switch.

Miscellany Summary

Constructor Details


Switch

C#: 
protected private Switch (string name,
    string valueHelp,
    bool required,
    string help)

VB: 
Protected Private Sub New(ByVal name As String, ByVal valueHelp As String, ByVal required As Boolean, ByVal help As String)

Constructor.

Parameters

name   the name of the switch; if it doesn't start with a hyphen. one is prepended.
valueHelp   describes the type of value expected by the switch (if any).
required   is this switch required?
help   a description of the switch.

Field Details


_help

C#: 
protected string _help;

VB: 
Protected _help As String


AllSwitches

C#: 
readonly static System.Collections.ArrayList AllSwitches;

VB: 
ReadOnly Shared AllSwitches As System.Collections.ArrayList

Whenever a switch is instantiated, it is added to this list.


Found

C#: 
bool Found;

VB: 
Found As Boolean

Tells whether the switch was found in the command line.


Name

C#: 
readonly string Name;

VB: 
ReadOnly Name As String

The name of the switch, including the initial hyphen.


NameLC

C#: 
readonly string NameLC;

VB: 
ReadOnly NameLC As String

The name of the switch in lower case.


Required

C#: 
readonly bool Required;

VB: 
ReadOnly Required As Boolean

Is this switch required?


ValueHelp

C#: 
readonly string ValueHelp;

VB: 
ReadOnly ValueHelp As String

Describes the type of value expected by the switch (if any).

Property Details


Help

C#: 
string Help

VB: 
Property Help() As String

Accessors:   get only

Help for the switch.

Method Details


Parse

C#: 
static Void Parse(StauffConsulting.Essentials.CmdLineParser p,
    System.Collections.ArrayList argList)

VB: 
Shared Function Parse(ByVal p As StauffConsulting.Essentials.CmdLineParser, ByVal argList As System.Collections.ArrayList) As Void

Tries to parse the next thing from the argument list. This is for internal use only by CmdLineParser.

Parameters

p  
argList  


WriteHelp

C#: 
Void WriteHelp(System.IO.TextWriter tw,
    int width)

VB: 
Function WriteHelp(ByVal tw As System.IO.TextWriter, ByVal width As Integer) As Void

Displays help for the switch.

Parameters

tw   where to write it
width   the width of the display in characters


generated by DocGenDotNet on 18 Nov 2008 6:35:01 PM