Exemple #1
0
 private void timer2_Tick()
 {
     while (true)
     {
         if (!InvokeRequired)
         {
             addBikeDataToList(new BikeData(bike.GetHeartRate(), bike.GetRPM(), (int)bike.GetSpeed(), bike.GetDistance(), bike.GetPower(), bike.GetEnergy(), bike.GetCurrentPower(), bike.GetTime()));
         }
         else
         {
             addBikeDataToListD delegatedata = addBikeDataToList;
             BikeData data = new BikeData(bike.GetHeartRate(), bike.GetRPM(), (int)bike.GetSpeed(), bike.GetDistance(), bike.GetPower(), bike.GetEnergy(), bike.GetCurrentPower(), bike.GetTime());
             delegatedata(data);
         }
         Thread.Sleep(60);
     }
 }
Exemple #2
0
 public void addBikeDataToList(BikeData bd)
 {
     data.Add(bd);
 }