예제 #1
0
        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();
        }
예제 #2
0
 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;
         }
     }
 }
예제 #3
0
        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;
            }
        }