Exemple #1
0
 private void FromXmlElements(XmlNodeList elems, IList <XmlCountrySettings> countrySettings)
 {
     if (elems != null)
     {
         foreach (XmlElement elem in elems)
         {
             var newCountrySettings = new XmlCountrySettings();
             FromXmlElement(elem, newCountrySettings);
             countrySettings.Add(newCountrySettings);
         }
     }
     AddMissingCountrySetting();
 }
Exemple #2
0
 private void AddMissingCountrySetting()
 {
     if (!_countrySettings.Exists(x => x.CountryName == Country.Ukraine))
     {
         var settings = new XmlCountrySettings();
         settings.CountryName = Country.Ukraine;
         settings.GroupNameList.Add(Operator.MTC);
         settings.GroupNameList.Add(Operator.Life);
         settings.GroupNameList.Add(Operator.Kievstar);
         _countrySettings.Add(settings);
     }
     if (!_countrySettings.Exists(x => x.CountryName == Country.Russia))
     {
         var settings = new XmlCountrySettings();
         settings.CountryName = Country.Russia;
         _countrySettings.Add(settings);
     }
 }
Exemple #3
0
        private void FromXmlElement(XmlElement elem, XmlCountrySettings countrySettings)
        {
            if (elem == null)
            {
                return;
            }
            countrySettings.CountryName = elem.GetAttribute("CountryName");
            var groupNameElems = elem.SelectNodes("tn:GroupName", _namespaceManager);

            if (groupNameElems == null || groupNameElems.Count == 0)
            {
                groupNameElems = elem.SelectNodes("GroupName");
            }
            foreach (XmlElement groupNameElem in groupNameElems)
            {
                if (groupNameElem != null)
                {
                    countrySettings.GroupNameList.Add(groupNameElem.InnerText);
                }
            }
        }