static Country ParseLine(string Line)
        {
            Country n = new Country();
            string[] parts = Line.Split('\t');
            int id = 0;

            n.ISOAlpha2 = parts[0];
            n.ISOAlpha3 = parts[1];
            n.ISONumeric = parts[2];
            n.FipsCode = parts[3];
            n.Name = parts[4];
            n.Capital = parts[5];
            n.Population = parts[6];
            n.ContinentId = parts[7];
            n.Continent = parts[8];
            n.tld = parts[9];
            n.CurrencyCode = parts[10];
            n.CurrencyName = parts[11];
            n.PhonePrefix = parts[12];
            n.PostalCodeFormat = parts[13];
            n.PostalCodeRegularExpression = parts[14].Trim();
            n.Languages = parts[15];
            n.Neighbours = parts[17];
            n.EquivalentFipsCode = parts[18];

            if (int.TryParse(parts[16], out id))
            {
                n.GeoNameId = id;
            }

            return n;
        }
Beispiel #2
0
 public IEnumerable<GeoName> ProvincesByCountry(Country Country)
 {
     return from p in GeoNames
            where p.FeatureClass == "ADM1" && string.Compare(p.CountryCode, Country.ISOAlpha2, true)==0
            select p;
 }
Beispiel #3
0
 public IEnumerable<GeoName> ProvincesByCountry(Country Country)
 {
     return from p in GeoNames where p.FeatureClass == "ADM1" && p.CountryCode == Country.ISOAlpha2 select p;
 }