本文整理汇总了C#中System.Reflection.Metadata.Ecma335.MetadataSizes.CalculateTableStreamHeaderSize方法的典型用法代码示例。如果您正苦于以下问题:C# MetadataSizes.CalculateTableStreamHeaderSize方法的具体用法?C# MetadataSizes.CalculateTableStreamHeaderSize怎么用?C# MetadataSizes.CalculateTableStreamHeaderSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Metadata.Ecma335.MetadataSizes
的用法示例。
在下文中一共展示了MetadataSizes.CalculateTableStreamHeaderSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeTablesHeader
private void SerializeTablesHeader(BlobBuilder writer, MetadataSizes metadataSizes)
{
int startPosition = writer.Position;
HeapSizeFlag heapSizes = 0;
if (metadataSizes.StringIndexSize > 2)
{
heapSizes |= HeapSizeFlag.StringHeapLarge;
}
if (metadataSizes.GuidIndexSize > 2)
{
heapSizes |= HeapSizeFlag.GuidHeapLarge;
}
if (metadataSizes.BlobIndexSize > 2)
{
heapSizes |= HeapSizeFlag.BlobHeapLarge;
}
if (metadataSizes.IsMinimalDelta)
{
heapSizes |= (HeapSizeFlag.EnCDeltas | HeapSizeFlag.DeletedMarks);
}
ulong sortedDebugTables = metadataSizes.PresentTablesMask & MetadataSizes.SortedDebugTables;
// Consider filtering out type system tables that are not present:
ulong sortedTables = sortedDebugTables | (metadataSizes.IsStandaloneDebugMetadata ? 0UL : 0x16003301fa00);
writer.WriteUInt32(0); // reserved
writer.WriteByte(MetadataFormatMajorVersion);
writer.WriteByte(MetadataFormatMinorVersion);
writer.WriteByte((byte)heapSizes);
writer.WriteByte(1); // reserved
writer.WriteUInt64(metadataSizes.PresentTablesMask);
writer.WriteUInt64(sortedTables);
MetadataWriterUtilities.SerializeRowCounts(writer, metadataSizes.RowCounts);
int endPosition = writer.Position;
Debug.Assert(metadataSizes.CalculateTableStreamHeaderSize() == endPosition - startPosition);
}