本文整理汇总了C#中Struct.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# Struct.Reset方法的具体用法?C# Struct.Reset怎么用?C# Struct.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Struct
的用法示例。
在下文中一共展示了Struct.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public override void Write(IO.EndianWriter stream)
{
const int k_alignment = Compiler.kDefaultAlignment;
int align;
using (var mem = InitializeMemoryStream())
{
DynamicTagGroups.Write(MemoryStream); // write the data array to the stream
MemoryStream.Write((int)0); MemoryStream.Write((int)0); // alignment
StringPoolToMemoryStream();
Import import = OwnerState.Importer as Import;
FixupsToMemoryStream();
#region Scripting
{
}
#endregion
EnumerationsToMemoryStream();
TagReferencesToMemoryStream();
TagDataToMemoryStream();
#region TagBlock
TagBlock tb = new TagBlock();
foreach (Import.TagBlock tagb in import.Blocks.Values)
{
tb.Reset(tagb);
tb.Write(MemoryStream);
}
#endregion
#region Struct
Struct strct = new Struct();
foreach (Import.Struct tags in import.Structs.Values)
{
strct.Reset(tags);
strct.Write(MemoryStream);
}
#endregion
#region TagGroup
TagGroup tg = new TagGroup();
foreach (Import.TagGroup tagg in import.Groups.Values)
{
tg.Reset(tagg);
tg.Write(MemoryStream);
}
#endregion
PostprocessWritebacks();
// Create header
PostprocessHeaderThenStream(stream, CalculateStringPoolBaseAddress());
mem.WriteTo(stream.BaseStream); // write all the data that will be read into memory from a tool to the file
}
align = k_alignment - (stream.Length % k_alignment);
if (align != k_alignment) stream.Write(new byte[align]);
}