private Task TakeAmbientMeasurements() { var ambTask = Task.Factory.StartNew(() => { var ambientLightEventArgs = new AmbientLightEventArgs { RawValue = RawAmbientLight }; AmbientLightReceived?.Invoke(this, ambientLightEventArgs); }); return(ambTask); }
private void _simulatorTimer_Tick(ThreadPoolTimer timer) { var random = new Random(); ProximityReceived?.Invoke(this, new ProximtyEventArgs { RawValue = random.Next(2000, 2500) }); AmbientLightReceived?.Invoke(this, new AmbientLightEventArgs { RawValue = random.Next(150, 500) }); }