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.181 -- Release Build+97279656b5a55675063a4190481e67c4f9809501
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