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

            if (_cities.Contains(city))
                return;

            _cities.Add(city);
            WriteToIsoStore();
        }
Esempio n. 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();
        }
Esempio n. 4
0
 public bool IsCitySaved(City city)
 {
     throw new NotImplementedException();
 }
Esempio n. 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();
 }