Enum..::..TryParse<(Of <(<'TEnum>)>)> Method (String, TEnum%)
Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. The return value indicates whether the conversion succeeded.
Namespace:
SystemAssembly: Bridge (in Bridge.dll)
Syntax
[TemplateAttribute] public static bool TryParse<TEnum>( string value, out TEnum result )
<TemplateAttribute> _ Public Shared Function TryParse(Of TEnum) ( _ value As String, _ <OutAttribute> ByRef result As TEnum _ ) As Boolean
[TemplateAttribute] public: generic<typename TEnum> static bool^ TryParse( String^ value, [OutAttribute] TEnum% result )
Type Parameters
- TEnum
- The enumeration type to which to convert value.
Parameters
- value
- Type: System..::..String
The string representation of the enumeration name or underlying value to convert.
- result
- Type: TEnum%
When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum. Note that this value need not be a member of the TEnum enumeration. This parameter is passed uninitialized.