Пример #1
0
        public static EDeviceFamily GetFamily(this EDevice device)
        {
            FieldInfo field = typeof(EDevice)
                              .GetFields(BindingFlags.Public | BindingFlags.Static)
                              .Where(fi => (EDevice)fi.GetValue(null) == device)
                              .Single();
            DeclareFamily famAttr = (DeclareFamily)field
                                    .GetCustomAttributes(typeof(DeclareFamily), false)
                                    .Single();

            return(famAttr.Family);
        }
Пример #2
0
 private static bool IsFamily(DeclareFamily declFamily, EDeviceFamily family)
 {
     return declFamily != null && declFamily.Family == family;
 }
Пример #3
0
 private static bool IsFamily(DeclareFamily declFamily, EDeviceFamily family)
 {
     return(declFamily != null && declFamily.Family == family);
 }