Exemple #1
0
 void ApiConnection_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     try
     {
         Data = JsonConvert.DeserializeObject<WeatherData>(e.Result);
         if (WeatherDataUpdated != null)
             WeatherDataUpdated(this, Data);
     }
     catch { }
 }
Exemple #2
0
 void weatherApi_WeatherDataUpdated(object sender, WeatherData e)
 {
     Console.WriteLine("Temperature: {0}F", Math.Round(e.list[0].main.temp_F, 0));
     foreach(WeatherDataCityWeather Weather in e.list[0].weather)
         Console.WriteLine("Condition: {0}", Weather.Condition);
 }