C# Класс Hourglass.CommandLineArguments

Parsed command-line arguments.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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 '''.

Описание методов

GetTimerOptions() публичный Метод

Returns the TimerOptions specified in the parsed command-line arguments.
public GetTimerOptions ( ) : TimerOptions
Результат Hourglass.Timing.TimerOptions

GetWindowSize() публичный Метод

Returns the WindowSize specified in the parsed command-line arguments.
public GetWindowSize ( ) : WindowSize
Результат WindowSize

Parse() публичный статический Метод

Parses command-line arguments.
public static Parse ( IList args ) : CommandLineArguments
args IList The command-line arguments.
Результат CommandLineArguments

ShowUsage() публичный статический Метод

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.)
Результат void