本文整理汇总了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);
}
示例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);
}
示例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]);
}
示例4: foreach
void IFastSerializable.ToStream(Serializer serializer)
{
serializer.Write(providers.Count);
foreach (ProviderManifest provider in providers.Values)
serializer.Write(provider);
}
示例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(", ");
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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("\"", "\\\"") + "\"]");
}
示例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);
}
示例12: Serialize
/// <summary>
/// Converts XValue into DDL.
/// </summary>
internal override void Serialize(Serializer serializer)
{
serializer.Write("\"" + this.Value + "\", ");
}
示例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");
}
示例14: foreach
void IFastSerializable.ToStream(Serializer serializer)
{
serializer.Write(m_templates.Count);
foreach (var template in m_templates)
serializer.Write(template);
}