Hidistro.Core/Entities/CustomerServiceSettings.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.Core.Entities
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Xml;

    public class CustomerServiceSettings
    {
        public static CustomerServiceSettings FromXml(XmlDocument doc)
        {
            XmlNode node = doc.SelectSingleNode("Settings");
            return new CustomerServiceSettings { AppId = node.SelectSingleNode("AppId").InnerText, AppSecret = node.SelectSingleNode("AppSecret").InnerText, unitid = node.SelectSingleNode("unitid").InnerText, unit = node.SelectSingleNode("unit").InnerText, password = node.SelectSingleNode("password").InnerText, unitname = node.SelectSingleNode("unitname").InnerText, activated = node.SelectSingleNode("activated").InnerText, logo = node.SelectSingleNode("logo").InnerText, url = node.SelectSingleNode("url").InnerText, tel = node.SelectSingleNode("tel").InnerText, contact = node.SelectSingleNode("contact").InnerText, location = node.SelectSingleNode("location").InnerText };
        }

        private static void SetNodeValue(XmlDocument doc, XmlNode root, string nodeName, string nodeValue)
        {
            XmlNode newChild = root.SelectSingleNode(nodeName);
            if (newChild == null)
            {
                newChild = doc.CreateElement(nodeName);
                root.AppendChild(newChild);
            }
            newChild.InnerText = nodeValue;
        }

        public void WriteToXml(XmlDocument doc)
        {
            XmlNode root = doc.SelectSingleNode("Settings");
            SetNodeValue(doc, root, "AppId", this.AppId);
            SetNodeValue(doc, root, "AppSecret", this.AppSecret);
            SetNodeValue(doc, root, "unitid", this.unitid);
            SetNodeValue(doc, root, "unit", this.unit);
            SetNodeValue(doc, root, "password", this.password);
            SetNodeValue(doc, root, "unitname", this.unitname);
            SetNodeValue(doc, root, "activated", this.activated);
            SetNodeValue(doc, root, "logo", this.logo);
            SetNodeValue(doc, root, "url", this.url);
            SetNodeValue(doc, root, "tel", this.tel);
            SetNodeValue(doc, root, "contact", this.contact);
            SetNodeValue(doc, root, "location", this.location);
        }

        public string activated { get; set; }

        public string AppId { get; set; }

        public string AppSecret { get; set; }

        public string contact { get; set; }

        public string location { get; set; }

        public string logo { get; set; }

        public string password { get; set; }

        public string tel { get; set; }

        public string unit { get; set; }

后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。