Exemplo n.º 1
0
 /// <summary>
 /// Gets settings section by name.
 /// </summary>
 /// <param name="sectionName">Section name.</param>
 /// <returns>Settings section.</returns>
 public OptimusMiniSettingsSection this[string sectionName]
 {
     get
       {
     if (_Sections.ContainsKey(sectionName))
     {
       return _Sections[sectionName];
     }
     else
     {
       OptimusMiniSettingsSection lSection = new OptimusMiniSettingsSection(sectionName);
       _Sections.Add(sectionName, lSection);
       return lSection;
     }
       }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Gets settings section by name.
 /// </summary>
 /// <param name="sectionName">Section name.</param>
 /// <returns>Settings section.</returns>
 public OptimusMiniSettingsSection this[string sectionName]
 {
     get
     {
         if (_Sections.ContainsKey(sectionName))
         {
             return(_Sections[sectionName]);
         }
         else
         {
             OptimusMiniSettingsSection lSection = new OptimusMiniSettingsSection(sectionName);
             _Sections.Add(sectionName, lSection);
             return(lSection);
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Loads settings from xml file.
        /// </summary>
        public void Load()
        {
            if (!File.Exists(_Path))
            {
                return;
            }

            XmlDocument lXml = new XmlDocument();

            lXml.Load(_Path);

            foreach (XmlElement lXmlSection in lXml.DocumentElement.ChildNodes)
            {
                OptimusMiniSettingsSection lSection = new OptimusMiniSettingsSection(lXmlSection.Attributes["Name"].Value);
                _Sections.Add(lSection.Name, lSection);

                foreach (XmlElement lXmlValue in lXmlSection.ChildNodes)
                {
                    lSection.List[lXmlValue.Attributes["Name"].Value] = lXmlValue.InnerText;
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Loads settings from xml file.
        /// </summary>
        public void Load()
        {
            if (!File.Exists(_Path)) { return; }

              XmlDocument lXml = new XmlDocument();
              lXml.Load(_Path);

              foreach (XmlElement lXmlSection in lXml.DocumentElement.ChildNodes)
              {
            OptimusMiniSettingsSection lSection = new OptimusMiniSettingsSection(lXmlSection.Attributes["Name"].Value);
            _Sections.Add(lSection.Name, lSection);

            foreach (XmlElement lXmlValue in lXmlSection.ChildNodes)
            {
              lSection.List[lXmlValue.Attributes["Name"].Value] = lXmlValue.InnerText;
            }
              }
        }