public override void TimerCallback(object state) { Debug.Print("Temperature Callback"); TempData tempData = new TempData(); // get current temperature tempData.SetValue(CalculateTemperature()); Debug.Print("Temperature = " + tempData.GetValue().ToString()); //Timer Callbacks receive a Delegate in the state object InputDataAvailable ida = (InputDataAvailable)state; // call out to the delegate with expected value ida(tempData); }
public override void TimerCallback(object state) { Debug.Print("Temperature Callback"); TempData tempData = new TempData(); // get current temperature tempData.SetValue(CalculateTemperature()); Debug.Print("Temperature = "+tempData.GetValue().ToString()); //Timer Callbacks receive a Delegate in the state object InputDataAvailable ida = (InputDataAvailable)state; // call out to the delegate with expected value ida(tempData); }