Ejemplo n.º 1
0
 private void decideAction(object input)
 {
     if (input == null)
     {
         return;
     }
     if (input is CPUInfo)
     {
         SystemDelegator.addCPU((CPUInfo)input);
     }
 }
 private void collectData()
 {
     while (shouldRun)
     {
         this.Dispatcher.Invoke((Action)(() =>
         {
             if (SystemDelegator.hasNew())
             {
                 var newInfo = SystemDelegator.getNewCPUs();
                 foreach (CPUInfo info in newInfo)
                 {
                     list.Add(info);
                 }
             }
         }));
         Thread.Sleep(1000);
     }
 }