private void LoadSelectedAirportFromDisk() { if (!_objectStore.FileExists(Airport.SelectedAirportFilename)) { return; } var savedAirport = _objectStore.Load <Airport>(Airport.SelectedAirportFilename); SelectedAirport = Airports.Where(a => a.Code == savedAirport.Code).Single(); }
private void LoadSelectedAirport() { if (_objectStore.FileExists("SelectedAirport")) { var airport = _objectStore.Load <Airport>("SelectedAirport"); if (airport.Equals(Airport.Nearest)) { _messenger.Publish(new FindNearestAirportMessage(this)); } else { SelectedAirport = airport; } } }
private void LoadSelectedAirportFromDisk() { if (!_objectStore.FileExists(ObjectStore.SelectedAirportFilename)) { return; } var airport = _objectStore.Load <Airport>(ObjectStore.SelectedAirportFilename); if (airport.Equals(Airport.Nearest)) { Messenger.Default.Send(new FindNearestAirportMessage()); } else { SelectedAirport = airport; } }