Exemple #1
0
 public void GetGeographyRepository(Action<GeographyRepository, Exception> callback)
 {
     var repo = new GeographyRepository();
     repo.CreateAll();
     callback(repo, null);
 }
Exemple #2
0
        private void GeographyRepositoryLoaded(GeographyRepository repo, Exception error)
        {
            if (error != null)
            {
                Messenger.Default.Send(new DialogMessage(error.ToString(), null) { Button = MessageBoxButton.OK, Caption = "Error" });
                return;
            }

            Continents.Clear();
            foreach (var continent in repo.Continents)
            {
                Continents.Add(continent);
            }

            CountriesRaw.Clear();
            foreach (var country in repo.Countries)
            {
                CountriesRaw.Add(country);
            }

            CitiesRaw.Clear();
            foreach (var city in repo.Cities)
            {
                CitiesRaw.Add(city);
            }

            ContinentFilterSelected();
        }