コード例 #1
0
 /// <summary>
 /// Consult the function from GetWeatherCore.GetStoredWeather, to gets the info from OpenWeatherMap's Api.
 /// </summary>
 private async Task GetResourceValues()
 {
     if (swChange.IsToggled)
     {
         NumberFormatInfo nfi = new NumberFormatInfo();
         nfi.NumberDecimalSeparator = ".";
         string[] values    = entry.Split(',');
         double   latitude  = double.Parse(values[0], nfi);
         double   longitude = double.Parse(values[1], nfi);
         App.Weather = await GetWeatherCore.GetCoordinate(latitude.ToString("0.000", nfi), longitude.ToString("0.000", nfi));
     }
     else
     {
         App.Weather = await GetWeatherCore.GetActualWeather(entry);
     }
 }
コード例 #2
0
 /// <summary>
 /// Consult the function from GetWeatherCore.GetStoredWeather, to gets the info from device.
 /// </summary>
 private async void GetLocalValues()
 {
     App.Weather = null;
     App.Weather = await GetWeatherCore.GetStoredWeather(filename, FOLDER);
 }