public static string GetTitle(this Enum value) { FieldInfo field; if (GetFieldInfo(value, out field)) { return(null); } ChartTypeAttribute attr = Attribute.GetCustomAttribute(field, typeof(ChartTypeAttribute)) as ChartTypeAttribute; return(attr?.Title); }
public static Type GetGeneratorClass(this Enum value) { FieldInfo field; if (GetFieldInfo(value, out field)) { return(null); } ChartTypeAttribute attr = Attribute.GetCustomAttribute(field, typeof(ChartTypeAttribute)) as ChartTypeAttribute; return(attr?.GeneratorClass); }