Table of Contents

Class ArgumentOptionExtensions

Namespace
Webefinity.Switch
Assembly
Switch.dll

Fluid extensions that define value providers for options.

public static class ArgumentOptionExtensions
Inheritance
ArgumentOptionExtensions
Inherited Members

Methods

AcceptDecimal(ArgumentOption, decimal?)

Add a value provider that accepts a floating point number.

public static ArgumentOption AcceptDecimal(this ArgumentOption option, decimal? defaultValue = null)

Parameters

option ArgumentOption

The option.

defaultValue decimal?

The default value, or null.

Returns

ArgumentOption

The option, for fluid extension.

AcceptDirectory(ArgumentOption, bool, string?)

Add a value provider that accepts a directory.

public static ArgumentOption AcceptDirectory(this ArgumentOption option, bool mustExist = false, string? defaultValue = null)

Parameters

option ArgumentOption

The option.

mustExist bool

Is the directory validated for existence?

defaultValue string

Returns

ArgumentOption

The option, for fluid extension.

AcceptEnum<TEnum>(ArgumentOption, object?)

Add a value provider that accepts an enum value

public static ArgumentOption AcceptEnum<TEnum>(this ArgumentOption option, object? defaultValue = null) where TEnum : Enum

Parameters

option ArgumentOption

The option.

defaultValue object

A default value, or null.

Returns

ArgumentOption

The option, for fluid extension.

Type Parameters

TEnum

The type of the enum to be used

AcceptFilename(ArgumentOption, bool, string?)

Add a value provider that accepts a filename.

public static ArgumentOption AcceptFilename(this ArgumentOption option, bool mustExist = false, string? defaultValue = null)

Parameters

option ArgumentOption

The option.

mustExist bool

Is the file validated for existence?

defaultValue string

Returns

ArgumentOption

The option, for fluid extension.

AcceptFlag(ArgumentOption, bool?)

Add a value provider that accepts a flag only, or a flag with the values true or false.

public static ArgumentOption AcceptFlag(this ArgumentOption option, bool? defaultValue = false)

Parameters

option ArgumentOption

The option.

defaultValue bool?

Returns

ArgumentOption

The option, for fluid extension.

AcceptInteger(ArgumentOption, long?)

Add a value provider that accepts an integer.

public static ArgumentOption AcceptInteger(this ArgumentOption option, long? defaultValue = null)

Parameters

option ArgumentOption

The option.

defaultValue long?

The default value, or null.

Returns

ArgumentOption

The option, for fluid extension.

AcceptString(ArgumentOption, string?)

Add a value provider that accepts a string.

public static ArgumentOption AcceptString(this ArgumentOption option, string? defaultValue = null)

Parameters

option ArgumentOption

The option.

defaultValue string

The default value, or null.

Returns

ArgumentOption

The option, for fluid extension.