Ejemplo n.º 1
0
        private void OnLoadWorldEarthquakesLocationsCompleted(object sender, AsyncCompletedEventArgs e)
        {
            var shapes = sender as ShapefileConverter;
            var items  = GeoDataParser.ProcessEarthQuakes(shapes);

            this.DataSources.Update(WorldEarthQuakesKey, new EarthQuakesViewSource {
                Source = items, DataSource = items
            });
            this.WorldEarthQuakes = this.DataSources[WorldEarthQuakesKey] as EarthQuakesViewSource;

            LoadingTimer.StopTask("LoadWorldEarthquakesLocations");
        }
Ejemplo n.º 2
0
        private void OnLoadWorldCitiesLocationsCompleted(object sender, AsyncCompletedEventArgs e)
        {
            var shapes = sender as ShapefileConverter;
            var items  = GeoDataParser.ProcessWorldCities(shapes);

            var dataViewSource = new WorldCitiesViewSource {
                Source = items, DataSource = items, DataSourceTrademark = CommonStrings.SourceData_GeoCommons
            };

            this.DataSources.Update(WorldCitiesKey, dataViewSource);
            //this.DataSources.Update(WorldCitiesKey, new WorldCitiesViewSource { Source = items, DataSource = items });
            this.WorldCities = this.DataSources[WorldCitiesKey] as WorldCitiesViewSource;

            LoadingTimer.StopTask("LoadWorldCitiesLocations");
        }
Ejemplo n.º 3
0
        //TODO-MT WeatherNoaaService
        //private void OnLoadWeatherDataListCompleted(object sender, GetWeatherNoaaDataListCompletedEventArgs e)
        //{
        //    var items = new List<WeatherNoaaData>();
        //    foreach (var location in e.Result)
        //    {
        //        if (!double.IsNaN(location.Temperature))
        //            items.Add(location);
        //        //Debug.WriteLine(ToString(location));
        //        //Debug.WriteLine(location.ToString());
        //    }
        //    this.DataSources.Update(WorldWeatherKey, new WeatherDataViewSource { Source = items, DataSource = items });
        //    this.WorldWeather = this.DataSources[WorldWeatherKey] as WeatherDataViewSource;

        //    LoadingTimer.StopTask("LoadWorldWeather");
        //}
        //private void OnLoadWeatherDataItemCompleted(object sender, GetWeatherNoaaDataCompletedEventArgs e)
        //{
        //    //TODO add updating weather data with individual data items
        //    //_worldWeather = new List<WeatherStation>();
        //    var weatherStations = e.Result;
        //}

        private void OnLoadWorldCountriesShapesCompleted(object sender, AsyncCompletedEventArgs e)
        {
            var shapes = sender as ShapefileConverter;
            var items  = GeoDataParser.ProcessWorldCountries(shapes);

            //var dataSource = new WorldCountriesViewSource {Source = items, DataSource = items};
            //dataSource.ItemsSourceKey = "WorldCountriesShapefile";
            //dataSource.FilterSettings.ItemsSourceKey = "WorldCountriesShapefile";
            //this.MapViewModel.DataSources.Update(dataSource.ItemsSourceKey, dataSource);
            //this.MapViewModel.WorldCountriesFilter = dataSource.FilterSettings as WorldCountriesFilterSettings;

            var dataViewSource = new WorldCountriesViewSource {
                Source = items, DataSource = items, DataSourceTrademark = CommonStrings.SourceData_USNA
            };

            this.DataSources.Update(WorldCountriesKey, dataViewSource);
            //this.DataSources.Update(WorldCountriesKey, new WorldCountriesViewSource { Source = items, DataSource = items });

            this.WorldCountries = this.DataSources[WorldCountriesKey] as WorldCountriesViewSource;
            this.WorldShapes    = shapes;

            LoadingTimer.StopTask("LoadWorldCountriesShapes");
        }