SettingsSectionParseTypedPrefixedValue Method

Gets the parsed type and value of a configuration setting value.

Definition

Namespace: Gemstone.Configuration
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.147 -- Release Build+759c9d29b79c81f10905de8f58b653be932045f0
public static (Type type, Object value) ParseTypedPrefixedValue(
	string? setting
)

Parameters

setting  String
Configuration setting value that can be prefixed with a type.

Return Value

ValueTupleType, Object
Tuple containing the parsed type and, value.

Remarks

Type name is parsed from the beginning of the setting value, if it exists, and is enclosed in brackets, e.g.: [int]:123 or [System.Int32]:123. If no type name is specified, the assumed default type will always be String.

Common C# names like long and DateTime can be used as type names as well as custom type names. Custom type names require the full type name with a namespace, e.g.: [MyNamespace.MyType]:TypeValue. Type name lookups are not case-sensitive.

Exceptions

InvalidOperationExceptionFailed to load specified type.
TypeLoadExceptionFailed to load type.

See Also