/// <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 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 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); } } }
/// <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 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); } }
/// <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); } } }
/// <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 (); }
/// <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); } }