Beispiel #1
0
        public CountryDataItem(int uniqueId, String name, String currency, String imagePath,
                               String capital,   // prep time
                               String startDate, // directions
                               String endDate,
                               String utc,
                               String region,
                               String longitude,
                               String latitude,
                               String dialCode,
                               String language,
                               String localTime,
                               CountryDataGroup group)
            : base(uniqueId, name, currency, imagePath)
        {
            this._capital   = capital;
            this._startDate = startDate;
            this._endDate   = endDate;
            this._utc       = utc;
            this.MapImage   = imagePath;
            this._region    = region;
            this._longitude = longitude;
            this._latitude  = latitude;
            this._dialCode  = dialCode;
            this._localTime = localTime;
            this._language  = language;

            this._group = group;
        }
Beispiel #2
0
        private static CountryDataGroup CreateCountryGroup(CountryDataItem cc)
        {
            CountryDataGroup group = new CountryDataGroup();

            group.UniqueId = cc.UniqueId;
            group.Name     = cc.Name;
            group.Currency = cc.Currency;
            group.Capital  = cc.Capital;
            group.Key      = cc.Key;
            _countryDataSource.AllGroups.Add(group);
            return(group);
        }
Beispiel #3
0
        private static void CreateCountrysAndCountryGroups(XDocument doc)
        {
            int i = 0;

            foreach (XElement e in doc.Descendants("Country"))
            {
                CountryDataItem  cc    = new CountryDataItem();
                CountryDataGroup group = null;

                cc.Name = e.Element("Name").Value;
                char key = char.ToUpper(cc.Name[0]);
                cc.Key        = key;
                cc.UniqueId   = ++i;
                cc.Capital    = e.Element("Capital").Value;
                cc.Currency   = e.Element("Currency").Value;
                cc.Region     = e.Element("Region").Value;
                cc.UTC        = e.Element("UTC").Value;
                cc.MapImage   = "png/" + (e.Element("Name").Value) + ".png";
                cc.CountryImg = "img/" + (e.Element("Name").Value) + ".png";
                cc.StartDate  = e.Element("StartDate").Value;
                cc.EndDate    = e.Element("EndDate").Value;
                cc.LocalTime  = e.Element("UTC").Value;
                cc.Longitude  = e.Element("Longitude").Value;
                cc.Latitude   = e.Element("Latitude").Value;
                cc.Language   = e.Element("Language").Value;
                cc.DialCode   = e.Element("DialCode").Value;

                group = _countryDataSource.AllGroups.FirstOrDefault(c => c.Key.Equals(key));

                if (group == null)
                {
                    group = CreateCountryGroup(cc);
                }

                cc.Group = group;

                if (group != null)
                {
                    group.Items.Add(cc);
                }
            }
        }
Beispiel #4
0
 private static CountryDataGroup CreateCountryGroup(CountryDataItem cc)
 {
     CountryDataGroup group = new CountryDataGroup();
     group.UniqueId = cc.UniqueId;
     group.Name = cc.Name;
     group.Currency = cc.Currency;
     group.Capital = cc.Capital;
     group.Key = cc.Key;
     _countryDataSource.AllGroups.Add(group);
     return group;
 }
Beispiel #5
0
 public CountryDataItem( int uniqueId, String name, String currency, String imagePath, 
                         String capital, // prep time 
                         String startDate, // directions 
                         String endDate,
                         String utc,
                         String region,
                         String longitude,
                         String latitude,
                         String dialCode,
                         String language,
                         String localTime,
                         CountryDataGroup group)
                         : base(uniqueId, name, currency, imagePath)
 {
     this._capital = capital;
     this._startDate = startDate;
     this._endDate = endDate;
     this._utc = utc;
     this.MapImage = imagePath;
     this._region = region;
     this._longitude = longitude;
     this._latitude = latitude;
     this._dialCode = dialCode;
     this._localTime = localTime;
     this._language = language;
   
     this._group = group;
 }