public static string GetLiteral(this System.Enum en)
{
System.Type type = en.GetType();
System.Reflection.MemberInfo[] memInfo = type.GetMember(en.ToString());
if (memInfo != null && memInfo.Length > 0)
{
object[] attrs = memInfo[0].GetCustomAttributes(typeof(Literal),
false);
if (attrs != null && attrs.Length > 0)
return ((Literal)attrs[0]).Text;
}
return null;
}