当前位置: 首页>>代码示例>>C#>>正文


C# Serializer.Write方法代码示例

本文整理汇总了C#中Serializer.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Serializer.Write方法的具体用法?C# Serializer.Write怎么用?C# Serializer.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Serializer的用法示例。


在下文中一共展示了Serializer.Write方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

    /// <summary>
    /// Converts PageField into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      string str = "\\field(Page)";

      if (this.format.Value != "")
        str += "[Format = \"" + this.Format + "\"]";
      else
        str += "[]"; //Has to be appended to avoid confusion with '[' in immediatly following text.

      serializer.Write(str);
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:14,代码来源:PageField.cs

示例2: Serialize

        /// <summary>
        /// Converts SectionField into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            string str = "\\field(Section)";

            if (_format.Value != "")
                str += "[Format = \"" + Format + "\"]";
            else
                str += "[]"; //Has to be appended to avoid confusion with '[' in directly following text.

            serializer.Write(str);
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:14,代码来源:SectionField.cs

示例3:

 void IFastSerializable.ToStream(Serializer serializer)
 {
     serializer.Write(majorVersion);
     serializer.Write(minorVersion);
     serializer.Write((int)format);
     int count = 0;
     if (serializedManifest != null)
         count = serializedManifest.Length;
     serializer.Write(count);
     for (int i = 0; i < count; i++)
         serializer.Write(serializedManifest[i]);
 }
开发者ID:Evlikat,项目名称:incinerate,代码行数:12,代码来源:DynamicTraceEventParser.cs

示例4: foreach

 void IFastSerializable.ToStream(Serializer serializer)
 {
     serializer.Write(providers.Count);
     foreach (ProviderManifest provider in providers.Values)
         serializer.Write(provider);
 }
开发者ID:Evlikat,项目名称:incinerate,代码行数:6,代码来源:DynamicTraceEventParser.cs

示例5: Serialize

    /// <summary>
    /// Converts Point into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      if (!this.IsNull("LineFormat") || !this.IsNull("FillFormat"))
      {
        serializer.WriteLine("");
        serializer.WriteLine("\\point");
        int pos = serializer.BeginAttributes();

        if (!this.IsNull("LineFormat"))
          this.lineFormat.Serialize(serializer);
        if (!this.IsNull("FillFormat"))
          this.fillFormat.Serialize(serializer);

        serializer.EndAttributes(pos);
        serializer.BeginContent();
        serializer.WriteLine(this.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));
        serializer.EndContent();
      }
      else
        serializer.Write(this.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));

      serializer.Write(", ");
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:26,代码来源:Point.cs

示例6: Serialize

 /// <summary>
 /// Converts SeriesElements into DDL.
 /// </summary>
 internal override void Serialize(Serializer serializer)
 {
     int count = Count;
       for (int index = 0; index < count; ++index)
       {
     Point point = this[index] as Point;
     if (point == null)
       serializer.Write("null, ");
     else
       point.Serialize(serializer);
       }
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:15,代码来源:SeriesElements.cs

示例7: Serialize

    /// <summary>
    /// Converts PageRefField into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      string str = "\\field(PageRef)";
      str += "[Name = \"" + this.Name + "\"";

      if (this.format.Value != "")
        str += " Format = \"" + this.Format + "\"";
      str += "]";

      serializer.Write(str);
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:14,代码来源:PageRefField.cs

示例8: Serialize

 /// <summary>
 /// Converts XSeriesElements into DDL.
 /// </summary>
 internal override void Serialize(Serializer serializer)
 {
     int count = Count;
     for (int index = 0; index < count; index++)
     {
         XValue xValue = this[index] as XValue;
         if (xValue == null)
             serializer.Write("null, ");
         else
             xValue.Serialize(serializer);
     }
 }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:15,代码来源:XSeriesElements.cs

示例9: WriteProperty

 /// <summary>
 /// Writes the specified property.
 /// </summary>
 /// <param name="serializer">
 /// The serializer.
 /// </param>
 /// <param name="inspectedProperty">
 /// The inspected property.
 /// </param>
 /// <param name="any">
 /// The object to which the property belongs.
 /// </param>
 private static void WriteProperty(Serializer serializer, InspectedProperty inspectedProperty, object any)
 {
     var value = inspectedProperty.Getter(any);
     if (value == null)
     {
         Encoder.WriteTag(serializer.BinaryWriter, Tags.Null);
     }
     else
     {
         serializer.Write(inspectedProperty.PropertyType, value.GetType(), value);
     }
 }
开发者ID:andysoftdev,项目名称:ht4o,代码行数:24,代码来源:TypeSchema.cs

示例10: Serialize

        /// <summary>
        /// Converts BookmarkField into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            if (this.name.Value == string.Empty)
            throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "BookmarkField"));

              serializer.Write("\\field(Bookmark)[Name = \"" + this.Name.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"]");
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:10,代码来源:BookmarkField.cs

示例11: Serialize

        /// <summary>
        /// Converts InfoField into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            string str = "\\field(Info)";
              if (this.Name == "")
            throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "InfoField"));
              str += "[Name = \"" + this.Name + "\"]";

              serializer.Write(str);
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:12,代码来源:InfoField.cs

示例12: Serialize

 /// <summary>
 /// Converts XValue into DDL.
 /// </summary>
 internal override void Serialize(Serializer serializer)
 {
     serializer.Write("\"" + this.Value + "\", ");
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:7,代码来源:XValue.cs

示例13: InitializeKernelNameMap

        void IFastSerializable.ToStream(Serializer serializer)
        {
            if (driveNames == null)
                InitializeKernelNameMap();
            // We mark the end of this set of variables so we can add to the end of it, since there is a
            // good chance we will have to change it.
            ForwardReference endOfKernelNameMap = serializer.GetForwardReference();
            serializer.Write(endOfKernelNameMap);
            serializer.Write(1);        // This is a version number.
            serializer.Write(driveNames.Length);
            serializer.Log("<WriteColection name=\"driveNames\" count=\"" + driveNames.Length + "\">\r\n");
            for (int i = 0; i < driveNames.Length; i++)
            {
                serializer.Write(driveNames[i]);
                serializer.Write(kernelNameForDrives[i]);
            }
            serializer.Log("</WriteColection>\r\n");
            serializer.Write(windows);
            serializer.Write(systemRoot);
            serializer.DefineForwardReference(endOfKernelNameMap);

            serializer.Write(threadIDtoProcessID.Count);
            serializer.Log("<WriteColection name=\"ProcessIDForThread\" count=\"" + threadIDtoProcessID.Count + "\">\r\n");
            foreach (HistoryDictionary<int>.HistoryValue entry in threadIDtoProcessID.Entries)
            {
                serializer.Write((long)entry.Key);
                serializer.Write(entry.StartTime100ns);
                serializer.Write(entry.Value);
            }
            serializer.Log("</WriteColection>\r\n");

            serializer.Log("<WriteColection name=\"fileIDToName\" count=\"" + fileIDToName.Count + "\">\r\n");
            serializer.Write(fileIDToName.Count);
            foreach (HistoryDictionary<string>.HistoryValue entry in fileIDToName.Entries)
            {
                serializer.Write((long)entry.Key);
                serializer.Write(entry.StartTime100ns);
                serializer.Write(entry.Value);
            }
            serializer.Log("</WriteColection>\r\n");
        }
开发者ID:Evlikat,项目名称:incinerate,代码行数:41,代码来源:KernelTraceEventParser.cs

示例14: foreach

 void IFastSerializable.ToStream(Serializer serializer)
 {
     serializer.Write(m_templates.Count);
     foreach (var template in m_templates)
         serializer.Write(template);
 }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:6,代码来源:RegisteredTraceEventParser.cs


注:本文中的Serializer.Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。