/// <summary> /// All the geocoding data can be gotten from: http://download.geonames.org/export/dump/ /// </summary> /// <param name="input"></param> public void SetCountryInfos(Stream input) { CountryInfos.Clear(); using (StreamReader db = new StreamReader(input)) { string line; while (!db.EndOfStream && (line = db.ReadLine()) != null) { if (line.StartsWith("#")) { continue; } var countryInfo = new CountryInfo(line); CountryInfos.Add(countryInfo); } } if (Places.Any()) { Places.ForEach(p => p.Country = CountryInfos.Find(c => c.ISO == p.CountryCode)); } }
public bool Equals(CountryInfo other) { return(other.ISO == this.ISO); }