enum State
{
Idle,
Walking,
Running,
Jumping,
Climbing,
Attacking
}
enum year
{
// items of the enum
January,
February,
March,
April,
May,
June
}
public T GetEnumFromString<T>(string value) where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
{
throw new ArgumentException("T must be an enumerated type");
}
//...
}
Creatinhg enums