Example #1
0
        /// <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);
        }
Example #2
0
        /// <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);
            }
        }
Example #3
0
 /// <summary>
 /// 修改设备信息
 /// </summary>
 /// <param name="dev"></param>
 public static void EditeDev(Dev dev)
 {
     Devs.EditeDev(dev);
     SaveAndReload();
 }
Example #4
0
 /// <summary>
 /// 添加设备信息
 /// </summary>
 /// <param name="dev">设备信息</param>
 public static void AddDev(Dev dev)
 {
     Devs.AddDev(dev);
     SaveAndReload();
 }