src/Library/NetPro.Utility/Helpers/Property.cs

(开头部分) 2KB

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

using System.Collections.Generic;
using System.Xml;
using System.Xml.Serialization;

namespace System.NetPro
{
    [Serializable]
    [XmlRoot("Property")]
    public class Property : IXmlSerializable
    {
        private Dictionary<string, string> _properties = new Dictionary<string, string>();
        public string this[string key]
        {
            get
            {
                if (_properties.ContainsKey(key))
                    return _properties[key];
                return null;
            }
            set
            {
                _properties[key] = value;
            }
        }

        public Dictionary<string, string> Properties
        {
            get
            {
                return _properties;
            }
        }

        #region IXmlSerializable 成员

        public System.Xml.Schema.XmlSchema GetSchema()
        {
            return null;
        }

        public void ReadXml(XmlReader reader)
        {
            if (reader.IsEmptyElement || !reader.Read())
            {
                return;
            }
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                if (reader.NodeType == XmlNodeType.Comment)
                {
                    reader.ReadEndElement();
                    reader.MoveToContent();
                    continue;
                }
                string key = reader.GetAttribute("key");

                reader.ReadStartElement("item");

                string value = reader.ReadContentAsString();

后面还有 26 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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