Description:

Converts an enumerated value name to its integer equivalent.

Syntax:
public static bool TryParseEnum(
Type type,
string enumValueName,
out int value
)
Parameters:
  • type
  • Type: System.Type
  • The enumerated type
  • enumValueName
  • Type: string
  • Enumerated value name as string
  • value
  • Type: int
  • Output value, will get set to -1 on error
Returns:
Type: bool
Returns True if the successfully converted or False if not.
Available since:
6.0

Description:

Converts an enumerated value string (integer as string) to a enumerated value name.

Syntax:
public static bool TryParseEnum(
Type type,
string intValueAsString,
out string value
)
Parameters:
  • type
  • Type: System.Type
  • The enumerated type
  • intValueAsString
  • Type: string
  • enumerated integer value as string
  • value
  • Type: string
  • Output value, will be None on error
Returns:
Type: bool
Returns True if the successfully converted or False if not.
Available since:
6.0

Nothing found