예제 #1
0
 public object Deserialize(object[] data)
 {
     var city = new City()
                    {
                        CityAndState = (string)data[0],
                        Weather = (CityWeather)data[1]
                    };
     return city;
 }
예제 #2
0
        public void AddCity(City city)
        {
            if (city == null)
                return;

            if (_cities.Contains(city))
                return;

            _cities.Add(city);
            WriteToIsoStore();
        }
예제 #3
0
        public void RemoveCity(City city)
        {
            if (city == null)
                return;

            if (_cities.Contains(city))
                _cities.Remove(city);

            if (_cities.Count == 0)
            {
                AddDefault();
                _messenger.Send(new RefreshMessage(true));
            }

            WriteToIsoStore();
        }
예제 #4
0
 public bool IsCitySaved(City city)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 private void LoadCities()
 {
     _cities = _cityService.Cities;
     if (_cities.Count == 0)
     {
         //there are no cities, setup with the defaults
         _cityService.AddCity(new City { CityAndState = "New York, NY"});
         _cityService.AddCity(new City { CityAndState = "Chicago, IL"});
         _cities = _cityService.Cities;
     }
     _selectedCity = _cities.First();
 }