public void SetDefaultSettingValue(string name, string value) { var valuePath = getValuePath(name); if (XMLUtil.NodeExists(defaultroot, valuePath)) { XMLUtil.SetNodeValue(defaultroot, valuePath, value); } else { var cfg = XMLUtil.AddNode(defaultroot, "config"); XMLUtil.AddAttribute(cfg, "name", name); XMLUtil.AddAttribute(cfg, "value", value); } }
public void SetValue(string name, int value) { var valuePath = getValuePath(name); if (XMLUtil.NodeExists(root, valuePath)) { XMLUtil.SetNodeValue(root, valuePath, value.ToString()); } else { if (root != null) { var cfg = XMLUtil.AddNode(root, "config"); XMLUtil.AddAttribute(cfg, "name", name); XMLUtil.AddAttribute(cfg, "value", value.ToString()); } } }
public static XmlAttribute AddAttribute(this XmlNode node, string name, string value) { return(XMLUtil.AddAttribute(node, name, value)); }