private static string GetTokenName(Type tokenType) { object[] attrs = tokenType.GetCustomAttributes(typeof(TagNameAttribute), true); return ((TagNameAttribute)attrs[0]).Name; }