public CityWeather(OpenWeatherMapService.CityCurrentWeatherInfo cityWeatherInfo) { this.cityWeatherInfo = cityWeatherInfo; this.weather = new Weather(cityWeatherInfo.main); this.weatherDescriptions = new List<WeatherDescription>(); foreach(OpenWeatherMapService.WeatherDescriptionInfo weatherDescription in cityWeatherInfo.weather) weatherDescriptions.Add(new WeatherDescription(weatherDescription)); }
public MapsModule() { InitializeComponent(); TilesLayer.DataProvider = MapUtils.CreateBingDataProvider(BingMapKind.Area); mapControl1.SetMapItemFactory(new DemoWeatherItemFactory()); this.openWeatherMapService = new OpenWeatherMapService(LoadCapitalsFromXML()); OpenWeatherMapService.ReadCompleted += OpenWeatherMapService_ReadCompleted; openWeatherMapService.GetWeatherAsync(); }
internal void SetForecast(OpenWeatherMapService.ForecastInfo forecast) { if(forecast == null) return; List<CityWeather> cityWeatherList = new List<CityWeather>(); for(int i = 0; i < forecast.list.Count; i++) cityWeatherList.Add(new CityWeather(forecast, i)); this.forecast = cityWeatherList; if(ForecastUpdated != null) ForecastUpdated(this, EventArgs.Empty); }
public CityWeather(OpenWeatherMapService.ForecastInfo forecast, int index) { OpenWeatherMapService.CityForecastWeatherInfo info = forecast.list[index]; OpenWeatherMapService.CityInfo cityInfo = forecast.city; this.cityWeatherInfo = new OpenWeatherMapService.CityCurrentWeatherInfo() { clouds = info.clouds, dt = info.dt, main = info.main, weather = info.weather, wind = info.wind, coord = cityInfo.coord, id = cityInfo.id, name = cityInfo.name }; this.weather = new Weather(cityWeatherInfo.main); this.weatherDescriptions = new List<WeatherDescription>(); foreach(OpenWeatherMapService.WeatherDescriptionInfo weatherDescription in cityWeatherInfo.weather) weatherDescriptions.Add(new WeatherDescription(weatherDescription)); }
public Weather(OpenWeatherMapService.WeatherInfo weatherInfo) { this.weatherInfo = weatherInfo; }
public WeatherDescription(OpenWeatherMapService.WeatherDescriptionInfo weatherDescriptionInfo) { this.weatherDescriptionInfo = weatherDescriptionInfo; }