예제 #1
0
파일: DataService.cs 프로젝트: Maskl/clime
 public void GetGeographyRepository(Action<GeographyRepository, Exception> callback)
 {
     var repo = new GeographyRepository();
     repo.CreateAll();
     callback(repo, null);
 }
예제 #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();
        }