UtilitiesParseEnumT Method (String, T) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Parses a string as a specified enum-type with the option to return a default value.

Namespace: ContentStudio.Site.Controls
Assembly: ContentStudio.Site.Controls (in ContentStudio.Site.Controls.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public static T ParseEnum<T>(
	string value,
	T defaultValue
)

Parameters

value
Type: SystemString
The value to parse. This parameter can be null or Empty to return the default value.
defaultValue
Type: T
A default value to return if value is null or Empty or is cannot be parsed.

Type Parameters

T
The type of enum to return

Return Value

Type: T
The parsed value as an enumeration
Exceptions

ExceptionCondition
ArgumentExceptionType parameter T is not an enum.
See Also

Reference