Esempio n. 1
0
 private async void RefreshTimerCallBack(object state)
 {
     await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                                                 () =>
     {
         Temperature = TemperatureSensor.Measure();
         State       = string.Concat("Temperature: ", Temperature.ToString(), "℃");
     }
                                                                                                 );
 }
Esempio n. 2
0
        private async void OnSend()
        {
            IsBusy = true;
            try
            {
                var temperatureToSend = TemperatureSensor.Measure();
                var result            = await MainManager.Send(temperatureToSend, DateTime.Now, DefaultLocation);

                Log += result;
            }
            catch (Exception ex)
            {
                State = ex.Message;
                Debug.WriteLine("Error : " + TemperatureSensor.Name + " - " + ex.Message);
            }

            IsBusy = false;
        }
Esempio n. 3
0
        private void OnTest()
        {
            IsBusy = true;

            try
            {
                var temperature = TemperatureSensor.Measure();
                Temperature = temperature;
                State       = string.Concat("Temperature: ", temperature.ToString(), "℃");
            }
            catch (Exception ex)
            {
                State = ex.Message;
                Debug.WriteLine("Error : " + TemperatureSensor.Name + " - " + ex.Message);
            }

            IsBusy = false;
        }