Exemple #1
0
 public Drive(IHardware hardware)
 {
     Hardware = hardware;
     Initialize();
     foreach (PropertyInfo prop in this.GetType().GetProperties())
     {
         if (prop.PropertyType == typeof(ISensor))
         {
             prop.SetValue(this, SensorTool.NAIfNull((ISensor)prop.GetValue(this)));
         }
     }
 }
Exemple #2
0
 public CPU(IHardware cpu)
 {
     Hardware = cpu;
     Cores    = new Dictionary <int, Core>();
     Initialize();
     foreach (PropertyInfo prop in this.GetType().GetProperties())
     {
         if (prop.PropertyType == typeof(ISensor))
         {
             prop.SetValue(this, SensorTool.NAIfNull((ISensor)prop.GetValue(this)));
         }
     }
 }
Exemple #3
0
 public Motherboard(IHardware hardware)
 {
     Hardware = hardware;
     foreach (PropertyInfo prop in this.GetType().GetProperties())
     {
         if (prop.PropertyType == typeof(List <ISensor>))
         {
             prop.SetValue(this, new List <ISensor>());
         }
     }
     Initialize();
     foreach (PropertyInfo prop in this.GetType().GetProperties())
     {
         if (prop.PropertyType == typeof(ISensor))
         {
             prop.SetValue(this, SensorTool.NAIfNull((ISensor)prop.GetValue(this)));
         }
     }
 }