예제 #1
0
 public static IEnumerable <EDevice> GetDevices(this EDeviceFamily family)
 {
     return(typeof(EDevice)
            .GetFields(BindingFlags.Public | BindingFlags.Static)
            .Where(fi => IsFamily((DeclareFamily)fi.GetCustomAttributes(typeof(DeclareFamily), false).SingleOrDefault(), family))
            .Select(fi => (EDevice)fi.GetValue(null)));
 }
예제 #2
0
 /// <summary>
 /// Constructs the attribute.
 /// </summary>
 /// <param name="family">device family</param>
 public DeclareFamily(EDeviceFamily family)
 {
     Family = family;
 }
예제 #3
0
 private static bool IsFamily(DeclareFamily declFamily, EDeviceFamily family)
 {
     return declFamily != null && declFamily.Family == family;
 }
예제 #4
0
 private static bool IsFamily(DeclareFamily declFamily, EDeviceFamily family)
 {
     return(declFamily != null && declFamily.Family == family);
 }
예제 #5
0
 /// <summary>
 /// Constructs the attribute.
 /// </summary>
 /// <param name="family">device family</param>
 public DeclareFamily(EDeviceFamily family)
 {
     Family = family;
 }