static void LoadStatistic(List <PopulationStatisticByYear> list, XElement populationDynamic)
 {
     foreach (XElement populationDynamicItem in populationDynamic.Elements("PopulationStatisticByYear"))
     {
         int    year         = int.Parse(populationDynamicItem.Element("Year").Value);
         long   population   = long.Parse(populationDynamicItem.Element("Population").Value);
         double urbanPercent = double.Parse(populationDynamicItem.Element("UrbanPercent").Value);
         PopulationStatisticByYear popDynamicItem = new PopulationStatisticByYear(year, population / 1000000.0, urbanPercent);
         list.Add(popDynamicItem);
     }
 }
Ejemplo n.º 2
0
        static List <PopulationStatisticByYear> LoadStatistic(XElement populationDynamic)
        {
            List <PopulationStatisticByYear> statistic = new List <PopulationStatisticByYear>();

            foreach (XElement populationDynamicItem in populationDynamic.Elements("PopulationStatisticByYear"))
            {
                int    year         = int.Parse(populationDynamicItem.Element("Year").Value);
                long   population   = long.Parse(populationDynamicItem.Element("Population").Value);
                double urbanPercent = double.Parse(populationDynamicItem.Element("UrbanPercent").Value, CultureInfo.InvariantCulture);
                PopulationStatisticByYear popDynamicItem = new PopulationStatisticByYear(year, (double)population / 1000000.0, urbanPercent);
                statistic.Add(popDynamicItem);
            }
            return(statistic);
        }