C# Class Hourglass.CommandLineArguments

Parsed command-line arguments.
Mostrar archivo Open project: Dziemborowicz/Hourglass Class Usage Examples

Public Methods

Method Description
GetTimerOptions ( ) : TimerOptions

Returns the TimerOptions specified in the parsed command-line arguments.

GetWindowSize ( ) : WindowSize

Returns the WindowSize specified in the parsed command-line arguments.

Parse ( IList args ) : CommandLineArguments

Parses command-line arguments.

ShowUsage ( string errorMessage = null ) : void

Shows the command-line usage of this application in a window.

Private Methods

Method Description
GetArgumentsFromFactoryDefaults ( ) : CommandLineArguments

Returns an CommandLineArguments instance based on the factory default settings.

GetArgumentsFromMostRecentOptions ( ) : CommandLineArguments

Returns an CommandLineArguments instance based on the most recent options.

GetBoolValue ( string arg, Queue remainingArgs ) : bool

Returns the next bool value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "on" or "off".

GetBoolValue ( string arg, Queue remainingArgs, bool last ) : bool

Returns the next bool value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "on", "off", or "last".

GetCommandLineArguments ( IEnumerable args ) : CommandLineArguments

Parses command-line arguments.

GetMostRecentWindowSize ( ) : WindowSize

Returns the most recent WindowSize.

GetRectValue ( string arg, Queue remainingArgs, Rect last ) : Rect

Returns the next Rect value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not a valid representation of a .

GetRequiredValue ( string arg, Queue remainingArgs ) : string

Returns the next value in remainingArgs, or throws an exception if is empty or the next argument in remainingArgs is a switch.

GetSoundValue ( string arg, Queue remainingArgs, Hourglass.Timing.Sound last ) : Hourglass.Timing.Sound

Returns the next Sound value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "none", "last", or a valid representation of a Sound.

GetThemeValue ( string arg, Queue remainingArgs, Theme last ) : Theme

Returns the next Theme value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "last" or a valid representation of a Theme.

GetTimerStartValue ( IEnumerable remainingArgs ) : TimerStart

Returns the TimerStart value corresponding to the concatenation of all , or throws an exception if the concatenation of all remainingArgs is not a valid representation of a TimerStart.

GetValue ( Queue remainingArgs ) : string

Returns the next value in remainingArgs.

GetWindowStateValue ( string arg, Queue remainingArgs, WindowState last ) : WindowState

Returns the next WindowState value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "normal", "maximized", "minimized", or "last".

GetWindowTitleModeValue ( string arg, Queue remainingArgs, WindowTitleMode last ) : WindowTitleMode

Returns the next WindowTitleMode value in remainingArgs, or throws an exception if remainingArgs is empty or the next argument is not "app", "left", "elapsed", "title", or "last".

IsSwitch ( string arg ) : bool

Returns a value indicating whether a string is a command-line switch.

ThrowIfDuplicateSwitch ( HashSet specifiedSwitches, string canonicalSwitch ) : void

Throws an exception if canonicalSwitch is already in specifiedSwitches, or otherwise adds canonicalSwitch to specifiedSwitches.

UnescapeValue ( string value ) : string

Unescapes a command-line value.

A value is any command-line argument not beginning with '-'. If the user must specify a command-line value that begins with '-', the user must escape the '-' with '''.

Method Details

GetTimerOptions() public method

Returns the TimerOptions specified in the parsed command-line arguments.
public GetTimerOptions ( ) : TimerOptions
return Hourglass.Timing.TimerOptions

GetWindowSize() public method

Returns the WindowSize specified in the parsed command-line arguments.
public GetWindowSize ( ) : WindowSize
return WindowSize

Parse() public static method

Parses command-line arguments.
public static Parse ( IList args ) : CommandLineArguments
args IList The command-line arguments.
return CommandLineArguments

ShowUsage() public static method

Shows the command-line usage of this application in a window.
public static ShowUsage ( string errorMessage = null ) : void
errorMessage string An error message to display. (Optional.)
return void