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

            if (_cities.Contains(city))
                return;

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