// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class GenCon { public static void EnumEnum(T o) where T : Enum { foreach(string nam in Enum.GetNames(typeof(T))) { Console.WriteLine("{0}{1}", nam, nam == o.ToString() ? "*" : ""); } } public enum A { X, Y, Z } public class B { } public static void Main(string[] args) { EnumEnum(A.Y); } }