예제 #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);
 }