示例#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));
 }
示例#2
0
文件: Maps.cs 项目: shine8319/DLS
        public MapsModule() {
            InitializeComponent();

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

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