コード例 #1
0
 public Task <bool> ActualizeAsync()
 {
     return(ExecuteSafe(async() =>
     {
         await Initialize();
         if (await _permissionsService.CanDownload())
         {
             foreach (var forecast in ForecastManager.GetForecasts())
             {
                 Uri url = GetApiUrl(forecast);
                 var service = new HttpService();
                 var feedresult = await service.DownloadAsync(url);
                 if (feedresult.IsRequestSuccessfull)
                 {
                     OpenWeatherMapHelper.EvaluateFeed(await feedresult.GetResponseAsStringAsync(),
                                                       _weatherFontMapping, forecast);
                 }
             }
             await SaveForecastsAsync();
         }
         return true;
     }));
 }
コード例 #2
0
 public OpenWeatherMapResult GetCityWeather(double latitude, double longitude)
 {
     return(OpenWeatherMapHelper.GetWeatherInformationForLocation(latitude, longitude));
 }