private static Attribute[] GetAttributes(this FamilyCode code) { var fi = code.GetType().GetField(code.ToString()); Attribute[] attributes = (Attribute[])fi.GetCustomAttributes(typeof(Attribute), false); return(attributes); }