Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        public MapsModule() {
            InitializeComponent();

            TilesLayer.DataProvider = MapUtils.CreateBingDataProvider(BingMapKind.Area);
            mapControl1.SetMapItemFactory(new DemoWeatherItemFactory());

            this.openWeatherMapService = new OpenWeatherMapService(LoadCapitalsFromXML());
            OpenWeatherMapService.ReadCompleted += OpenWeatherMapService_ReadCompleted;
            openWeatherMapService.GetWeatherAsync();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
 public Weather(OpenWeatherMapService.WeatherInfo weatherInfo) {
     this.weatherInfo = weatherInfo;
 }
Ejemplo n.º 6
0
 public WeatherDescription(OpenWeatherMapService.WeatherDescriptionInfo weatherDescriptionInfo) {
     this.weatherDescriptionInfo = weatherDescriptionInfo;
 }