/// <summary> /// 添加设备信息 /// </summary> /// <param name="dev"></param> public void AddDev(Dev dev) { XmlElement devX = XMLMaster.XMLHelper._xmldoc.CreateElement("Dev"); devX.SetAttribute("id", dev.ID); devX.SetAttribute("name", dev.Name); devX.SetAttribute("type", dev.Type); devX.SetAttribute("ip", dev.IP); devX.SetAttribute("port", dev.Port); XMLMaster.XMLHelper.AddToNode("//Config/Devs", devX); }
/// <summary> /// 修改设备信息 /// </summary> /// <param name="dev"></param> public void EditeDev(Dev dev) { XmlElement devx = XMLMaster.XMLHelper.GetSingleNode("//Config/Devs/Dev[@id='" + dev.ID + "']"); if (devx != null) { devx.SetAttribute("name", dev.Name); devx.SetAttribute("type", dev.Type); devx.SetAttribute("ip", dev.IP); devx.SetAttribute("port", dev.Port); } }
/// <summary> /// 修改设备信息 /// </summary> /// <param name="dev"></param> public static void EditeDev(Dev dev) { Devs.EditeDev(dev); SaveAndReload(); }
/// <summary> /// 添加设备信息 /// </summary> /// <param name="dev">设备信息</param> public static void AddDev(Dev dev) { Devs.AddDev(dev); SaveAndReload(); }