using System;
using System.Collections.Generic;
using System.Reflection;
namespace Velocity
{
public static class Util
{
public static List GetEnumValues()
{
Type currentEnum = typeof(T);
List resultSet = new List();
if (currentEnum.IsEnum)
{
FieldInfo[] fields = currentEnum.GetFields(BindingFlags.Static | BindingFlags.Public);
foreach (FieldInfo field in fields)
resultSet.Add((T)field.GetValue(null));
}
else
throw new ArgumentException("The argument must of type Enum or of a type derived from Enum", "T");
return resultSet;
}
}
}