public object Deserialize(object[] data) { var city = new City() { CityAndState = (string)data[0], Weather = (CityWeather)data[1] }; return city; }
public void AddCity(City city) { if (city == null) return; if (_cities.Contains(city)) return; _cities.Add(city); WriteToIsoStore(); }
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(); }
public bool IsCitySaved(City city) { throw new NotImplementedException(); }
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(); }