BlogEngine.Core/DataStore/SerializableStringDictionary.cs

(开头部分) 1KB

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

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

namespace BlogEngine.Core.DataStore
{
  /// <summary>
  /// Serializable String Dictionary
  /// </summary>
  [CLSCompliant(true)]
  [Serializable()]
  public class SerializableStringDictionary : StringDictionary, IXmlSerializable
  {
    #region IXmlSerializable Members

    /// <summary>
    /// Get Schema
    /// </summary>
    /// <returns></returns>
    public System.Xml.Schema.XmlSchema GetSchema()
    {
      return null;
    }
    /// <summary>
    /// Generates a collection from its XML representation.
    /// </summary>
    /// <param name="reader">System.Xml.XmlReader</param>
    public void ReadXml(System.Xml.XmlReader reader)
    {
      this.Clear();
      if (reader.ReadToDescendant("SerializableStringDictionary"))
      {
        if (reader.ReadToDescendant("DictionaryEntry"))
        {
          do
          {
            reader.MoveToAttribute("Key");
            string key = reader.ReadContentAsString();
            reader.MoveToAttribute("Value");
            string value = reader.ReadContentAsString();

            this.Add(key, value);

          } while (reader.ReadToNextSibling("DictionaryEntry"));
        }
      }
    }
    /// <summary>
    /// Loads collection to XML writer
    /// </summary>
    /// <param name="writer">System.Xml.XmlWriter</param>
    public void WriteXml(System.Xml.XmlWriter writer)
    {
      writer.WriteStartElement("SerializableStringDictionary");
      foreach (DictionaryEntry entry in this)
      {
        writer.WriteStartElement("DictionaryEntry");
后面还有 10 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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