I like to do something like this:
public static List<string> ItemsOfEnum(T typeT)
{
List<string> items = new List<string>();
foreach (typeT tItem in Enum.GetValues(typeof(typeT)))
items.Add(tItem);
return items;
}
How to get the “T” in the parameter-list without changing the return type (List)?
Seems to easy… but maybe that’s what you were looking for?
Note that C# doesn’t allow to constrain to enums, so those constraints are more or less the closes you can get.