Table of Contents

Class TMPParameterUtility

Utility class for easy parameter handling.

public static class TMPParameterUtility
Inheritance
TMPParameterUtility
Inherited Members

Methods

HasArrayParameter(IDictionary<string, string>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can no be converted to Array<T>).

public static bool HasArrayParameter(IDictionary<string, string> parameters, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

HasArrayParameter<T>(IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can no be converted to Array<T>).

public static bool HasArrayParameter<T>(IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>

The delegate used to parse the array items.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

Type Parameters

T

HasArrayParameter<T>(IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, ITMPKeywordDatabase, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can no be converted to Array<T>).

public static bool HasArrayParameter<T>(IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, ITMPKeywordDatabase keywords, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>

The delegate used to parse the array items.

keywords ITMPKeywordDatabase

The keyword database to use.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

Type Parameters

T

HasNonArrayParameter(IDictionary<string, string>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is not of type Array<T> (=> can not be converted to Array<T>).

public static bool HasNonArrayParameter(IDictionary<string, string> parameters, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is not of type Array<T>, false otherwise.

HasNonArrayParameter<T>(IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is not of type Array<T> (=> can not be converted to Array<T>).

public static bool HasNonArrayParameter<T>(IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>
name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is not of type Array<T>, false otherwise.

Type Parameters

T

HasNonArrayParameter<T>(IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, ITMPKeywordDatabase, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is not of type Array<T> (=> can not be converted to Array<T>).

public static bool HasNonArrayParameter<T>(IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, ITMPKeywordDatabase keywords, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>

The delegate used to parse the array items.

keywords ITMPKeywordDatabase

The keyword database to use.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is not of type Array<T>, false otherwise.

Type Parameters

T

ParameterDefined(IDictionary<string, string>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases.
A parameter is well-defined if there is exactly one of the given aliases (including the name) present in the parameters.

public static bool ParameterDefined(IDictionary<string, string> parameters, string name, params string[] aliases)

Parameters

parameters IDictionary<string, string>

The parameters to check.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if the parameter is well-defined, false otherwise.

TryGetArrayParameter(out string[], IDictionary<string, string>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can be converted to Array<T>).

public static bool TryGetArrayParameter(out string[] value, IDictionary<string, string> parameters, string name, params string[] aliases)

Parameters

value string[]

Set to the value of the parameter if successful.

parameters IDictionary<string, string>

The parameters to check.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

TryGetArrayParameter<T>(out T[], IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can be converted to Array<T>).

public static bool TryGetArrayParameter<T>(out T[] value, IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, string name, params string[] aliases)

Parameters

value T[]

Set to the value of the parameter if successful.

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>

The delegate used to parse the array items.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

Type Parameters

T

TryGetArrayParameter<T>(out T[], IDictionary<string, string>, ParseDelegate<string, T, ITMPKeywordDatabase, bool>, ITMPKeywordDatabase, string, params string[])

Check if there is a well-defined parameter of the given name or aliases that is of type Array<T> (=> can be converted to Array<T>).

public static bool TryGetArrayParameter<T>(out T[] value, IDictionary<string, string> parameters, TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool> func, ITMPKeywordDatabase keywords, string name, params string[] aliases)

Parameters

value T[]

Set to the value of the parameter if successful.

parameters IDictionary<string, string>

The parameters to check.

func TMPParameterUtility.ParseDelegate<string, T, ITMPKeywordDatabase, bool>

The delegate used to parse the array items.

keywords ITMPKeywordDatabase

The keyword database to use.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if there is a well-defined parameter that is of type Array<T>, false otherwise.

Type Parameters

T

TryGetDefinedParameter(out string, IDictionary<string, string>, string, params string[])

Check if there is a well-defined parameter of the given name or aliases.
A parameter is well-defined if there is exactly one of the given aliases (including the name) present in the parameters.

public static bool TryGetDefinedParameter(out string value, IDictionary<string, string> parameters, string name, params string[] aliases)

Parameters

value string

Set to the name of the defined parameter if successful.

parameters IDictionary<string, string>

The parameters to check.

name string

The name to check.

aliases string[]

The aliases (alternative names) to check.

Returns

bool

true if the parameter is well-defined, false otherwise.