Hishop.Plugins/ConfigData.cs

(开头部分) 1KB

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

namespace Hishop.Plugins
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.CompilerServices;
    using System.Xml;

    public class ConfigData
    {
        private readonly XmlDocument doc;
        private readonly XmlNode root;

        public ConfigData()
        {
            this.IsValid = true;
            this.ErrorMsgs = new List<string>();
            this.doc = new XmlDocument();
            this.root = this.doc.CreateElement("xml");
            this.doc.AppendChild(this.root);
        }

        public ConfigData(string xml)
        {
            this.IsValid = true;
            this.ErrorMsgs = new List<string>();
            this.doc = new XmlDocument();
            this.doc.LoadXml(xml);
            this.root = this.doc.FirstChild;
        }

        internal void Add(string attributeName, string val)
        {
            if (((!string.IsNullOrEmpty(attributeName) && !string.IsNullOrEmpty(val)) && (attributeName.Trim().Length > 0)) && (val.Length > 0))
            {
                XmlNode newChild = this.doc.CreateElement(attributeName);
                newChild.InnerText = val;
                this.root.AppendChild(newChild);
            }
        }

        internal XmlNodeList AttributeNodes
        {
            get
            {
                return this.root.ChildNodes;
            }
        }

        public IList<string> ErrorMsgs { get; private set; }

        public bool IsValid { get; internal set; }

        public bool NeedProtect { get; internal set; }

        public string SettingsXml
        {
            get
            {
                return this.root.OuterXml;
            }
后面还有 4 行代码,购买后查看完整代码

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

AI 解读 AI

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

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