Ejemplo n.º 1
0
        /// <summary>
        /// Loads all keys for a config.
        /// </summary>
        private void LoadKeys(XmlNode node, ConfigBase config)
        {
            XmlNodeList nodeList = node.SelectNodes("Key");

            for (int i = 0; i < nodeList.Count; i++)
            {
                config.Add(nodeList[i].Attributes["Name"].Value,
                           nodeList[i].Attributes["Value"].Value);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads all keys for a config.
 /// </summary>
 private void LoadKeys(XmlNode node, ConfigBase config)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         if (child.NodeType == XmlNodeType.Element &&
             child.Name == "Key")
         {
             config.Add(child.Attributes["Name"].Value,
                        child.Attributes["Value"].Value);
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads all keys for a config.
        /// </summary>
        private void LoadKeys(XmlNode rootNode, ConfigBase config)
        {
            XmlNode section = GetChildElement(rootNode, config.Name);

            foreach (XmlNode node in section.ChildNodes)
            {
                if (node.NodeType == XmlNodeType.Element &&
                    node.Name == "add")
                {
                    config.Add(node.Attributes["key"].Value,
                               node.Attributes["value"].Value);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Loads a collection class.
        /// </summary>
        private void LoadCollection(string name, NameValueCollection collection)
        {
            ConfigBase config = new ConfigBase(name, this);

            if (collection == null)
            {
                throw new ArgumentException("Section was not found");
            }

            if (collection != null)
            {
                for (int i = 0; i < collection.Count; i++)
                {
                    config.Add(collection.Keys[i], collection[i]);
                }

                this.Configs.Add(config);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Loads the configuration file.
        /// </summary>
        private void Load()
        {
            ConfigBase config  = null;
            IniSection section = null;
            IniItem    item    = null;

            for (int j = 0; j < iniDocument.Sections.Count; j++)
            {
                section = iniDocument.Sections[j];
                config  = new ConfigBase(section.Name, this);

                for (int i = 0; i < section.ItemCount; i++)
                {
                    item = section.GetItem(i);

                    if (item.Type == IniType.Key)
                    {
                        config.Add(item.Name, item.Value);
                    }
                }

                this.Configs.Add(config);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Loads all keys for a config.
        /// </summary>
        private void LoadKeys(XmlNode rootNode, ConfigBase config)
        {
            XmlNode section = GetChildElement (rootNode, config.Name);

            foreach (XmlNode node in section.ChildNodes)
            {
                if (node.NodeType == XmlNodeType.Element
                    && node.Name == "add") {
                    config.Add (node.Attributes["key"].Value,
                                node.Attributes["value"].Value);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Loads a collection class.
        /// </summary>
        private void LoadCollection(string name, NameValueCollection collection)
        {
            ConfigBase config = new ConfigBase (name, this);

            if (collection == null) {
                throw new ArgumentException ("Section was not found");
            }

            if (collection != null) {
                for (int i = 0; i < collection.Count; i++)
                {
                    config.Add (collection.Keys[i], collection[i]);
                }

                this.Configs.Add (config);
            }
        }
 /// <summary>
 /// Loads all keys for a config.
 /// </summary>
 private void LoadKeys(XmlNode node, ConfigBase config)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         if (child.NodeType == XmlNodeType.Element
             && child.Name == "Key") {
             config.Add (child.Attributes["Name"].Value,
                         child.Attributes["Value"].Value);
         }
     }
 }
        /// <summary>
        /// Loads the configuration file.
        /// </summary>
        private void Load()
        {
            ConfigBase config = null;
            IniSection section = null;
            IniItem item = null;

            for (int j = 0; j < iniDocument.Sections.Count; j++)
            {
                section = iniDocument.Sections[j];
                config = new ConfigBase (section.Name, this);

                for (int i = 0; i < section.ItemCount; i++)
                {
                    item = section.GetItem (i);

                    if  (item.Type == IniType.Key) {
                        config.Add (item.Name, item.Value);
                    }
                }

                this.Configs.Add (config);
            }
            base.ReplaceTextAll ();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Loads all keys for a config.
        /// </summary>
        private void LoadKeys(XmlNode node, ConfigBase config)
        {
            XmlNodeList nodeList = node.SelectNodes ("Key");

            for (int i = 0; i < nodeList.Count; i++)
            {
                config.Add (nodeList[i].Attributes["Name"].Value,
                            nodeList[i].Attributes["Value"].Value);
            }
        }
        /// <summary>
        /// Loads all keys for a config.
        /// </summary>
        private void LoadKeys(XmlNode rootNode, ConfigBase config)
        {
            XmlNodeList nodeList = rootNode.SelectNodes (config.Name + "/add");

            for (int i = 0; i < nodeList.Count; i++)
            {
                config.Add (nodeList[i].Attributes["key"].Value,
                            nodeList[i].Attributes["value"].Value);
            }
        }