[This is preliminary documentation and is subject to change.]
Attempts to parse a given key's value as an enumeration.
An ArgumentException is thrown if value could not be parsed.
Note the parsing is done in a case-insensitive way.
Namespace: fCraftAssembly: fCraft (in fCraft.dll) Version: 0.6.3.5 (0.6.3.5)
Syntax
| C# |
public static TEnum GetEnum<TEnum>( this ConfigKey key ) where TEnum : struct, new()
Parameters
- key
- ConfigKey
Type Parameters
- TEnum
- Enum to use for parsing. An ArgumentException will be thrown if this is not an enum.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ConfigKey. When you use instance method syntax to call this method, omit the first parameter.
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentException | TEnum is not an System.Enum. -or- key value is either an empty string ("") or only contains white space. -or- value is a name, but not one of the named constants defined for the enumeration. |