• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Ecma335.MetadataSizes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Reflection.Metadata.Ecma335.MetadataSizes的典型用法代码示例。如果您正苦于以下问题:C# MetadataSizes类的具体用法?C# MetadataSizes怎么用?C# MetadataSizes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetadataSizes类属于System.Reflection.Metadata.Ecma335命名空间,在下文中一共展示了MetadataSizes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SerializedMetadata

 public SerializedMetadata(
     MetadataSizes sizes,
     BlobBuilder stringHeap,
     ImmutableArray<int> stringMap)
 {
     Sizes = sizes;
     StringHeap = stringHeap;
     StringMap = stringMap;
 }
开发者ID:ESgarbi,项目名称:corefx,代码行数:9,代码来源:SerializedMetadataHeaps.cs


示例2: GetSerializedMetadata

        internal SerializedMetadata GetSerializedMetadata(ImmutableArray<int> externalRowCounts, int metadataVersionByteCount, bool isStandaloneDebugMetadata)
        {
            var stringHeapBuilder = new HeapBlobBuilder(_stringHeapCapacity);
            var stringMap = SerializeStringHeap(stringHeapBuilder, _strings, _stringHeapStartOffset);

            Debug.Assert(HeapIndex.UserString == 0);
            Debug.Assert((int)HeapIndex.String == 1);
            Debug.Assert((int)HeapIndex.Blob == 2);
            Debug.Assert((int)HeapIndex.Guid == 3);

            var heapSizes = ImmutableArray.Create(
                _userStringBuilder.Count,
                stringHeapBuilder.Count,
                _blobHeapSize,
                _guidBuilder.Count);

            var sizes = new MetadataSizes(GetRowCounts(), externalRowCounts, heapSizes, metadataVersionByteCount, isStandaloneDebugMetadata);

            return new SerializedMetadata(sizes, stringHeapBuilder, stringMap);
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:20,代码来源:MetadataBuilder.cs


示例3: SerializeCustomDebugInformationTable

 private void SerializeCustomDebugInformationTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     // Note: we can sort the table at this point since no other table can reference its rows via RowId or CodedIndex (which would need updating otherwise).
     // OrderBy performs a stable sort, so multiple attributes with the same parent and kind will be sorted in the order they were added to the table.
     foreach (CustomDebugInformationRow row in _customDebugInformationTable.OrderBy((x, y) =>
     {
         int result = (int)x.Parent - (int)y.Parent;
         return (result != 0) ? result : MetadataTokens.GetHeapOffset(x.Kind) - MetadataTokens.GetHeapOffset(y.Kind);
     }))
     {
         writer.WriteReference(row.Parent, metadataSizes.HasCustomDebugInformationSize);
         writer.WriteReference((uint)GetHeapOffset(row.Kind), metadataSizes.GuidIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.Value), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:15,代码来源:MetadataBuilder.Tables.cs


示例4: SerializeImportScopeTable

 private void SerializeImportScopeTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _importScopeTable)
     {
         writer.WriteReference(row.Parent, metadataSizes.ImportScopeIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.Imports), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:8,代码来源:MetadataBuilder.Tables.cs


示例5: SerializeLocalVariableTable

 private void SerializeLocalVariableTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _localVariableTable)
     {
         writer.WriteUInt16(row.Attributes);
         writer.WriteUInt16(row.Index);
         writer.WriteReference((uint)GetHeapOffset(row.Name), metadataSizes.StringIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:9,代码来源:MetadataBuilder.Tables.cs


示例6: SerializeMethodDebugInformationTable

 private void SerializeMethodDebugInformationTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _methodDebugInformationTable)
     {
         writer.WriteReference(row.Document, metadataSizes.DocumentIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.SequencePoints), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:8,代码来源:MetadataBuilder.Tables.cs


示例7: SerializeMethodSpecTable

 private void SerializeMethodSpecTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (MethodSpecRow methodSpec in _methodSpecTable)
     {
         writer.WriteReference(methodSpec.Method, metadataSizes.MethodDefOrRefCodedIndexSize);
         writer.WriteReference((uint)GetHeapOffset(methodSpec.Instantiation), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:8,代码来源:MetadataBuilder.Tables.cs


示例8: SerializeGenericParamTable

        private void SerializeGenericParamTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _genericParamTable.Count; i++)
            {
                Debug.Assert(
                    _genericParamTable[i - 1].Owner < _genericParamTable[i].Owner ||
                    _genericParamTable[i - 1].Owner == _genericParamTable[i].Owner && _genericParamTable[i - 1].Number < _genericParamTable[i].Number);
            }
#endif            
            foreach (GenericParamRow genericParam in _genericParamTable)
            {
                writer.WriteUInt16(genericParam.Number);
                writer.WriteUInt16(genericParam.Flags);
                writer.WriteReference(genericParam.Owner, metadataSizes.TypeOrMethodDefCodedIndexSize);
                writer.WriteReference((uint)GetHeapOffset(genericParam.Name), metadataSizes.StringIndexSize);
            }
        }
开发者ID:tzetang,项目名称:corefx,代码行数:18,代码来源:MetadataBuilder.Tables.cs


示例9: SerializeMethodImplTable

        private void SerializeMethodImplTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _methodImplTable.Count; i++)
            {
                Debug.Assert(_methodImplTable[i - 1].Class <= _methodImplTable[i].Class);
            }
#endif
            foreach (MethodImplRow methodImpl in _methodImplTable)
            {
                writer.WriteReference(methodImpl.Class, metadataSizes.TypeDefIndexSize);
                writer.WriteReference(methodImpl.MethodBody, metadataSizes.MethodDefOrRefCodedIndexSize);
                writer.WriteReference(methodImpl.MethodDecl, metadataSizes.MethodDefOrRefCodedIndexSize);
            }
        }
开发者ID:tzetang,项目名称:corefx,代码行数:15,代码来源:MetadataBuilder.Tables.cs


示例10: SerializeMethodSemanticsTable

 private void SerializeMethodSemanticsTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     // Note: we can sort the table at this point since no other table can reference its rows via RowId or CodedIndex (which would need updating otherwise).
     // OrderBy performs a stable sort, so multiple attributes with the same parent will be sorted in the order they were added to the table.
     var ordered = _methodSemanticsTableNeedsSorting ? (IEnumerable<MethodSemanticsRow>)_methodSemanticsTable.OrderBy((x, y) => (int)x.Association - (int)y.Association) : _methodSemanticsTable;
     
     foreach (MethodSemanticsRow methodSemantic in ordered)
     {
         writer.WriteUInt16(methodSemantic.Semantic);
         writer.WriteReference(methodSemantic.Method, metadataSizes.MethodDefIndexSize);
         writer.WriteReference(methodSemantic.Association, metadataSizes.HasSemanticsCodedIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:13,代码来源:MetadataBuilder.Tables.cs


示例11: SerializePropertyTable

 private void SerializePropertyTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (PropertyRow property in _propertyTable)
     {
         writer.WriteUInt16(property.PropFlags);
         writer.WriteReference((uint)GetHeapOffset(property.Name), metadataSizes.StringIndexSize);
         writer.WriteReference((uint)GetHeapOffset(property.Type), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:9,代码来源:MetadataBuilder.Tables.cs


示例12: SerializePropertyMapTable

 private void SerializePropertyMapTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (PropertyMapRow propertyMap in _propertyMapTable)
     {
         writer.WriteReference(propertyMap.Parent, metadataSizes.TypeDefIndexSize);
         writer.WriteReference(propertyMap.PropertyList, metadataSizes.PropertyDefIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:8,代码来源:MetadataBuilder.Tables.cs


示例13: SerializeEventTable

 private void SerializeEventTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (EventRow eventRow in _eventTable)
     {
         writer.WriteUInt16(eventRow.EventFlags);
         writer.WriteReference((uint)GetHeapOffset(eventRow.Name), metadataSizes.StringIndexSize);
         writer.WriteReference(eventRow.EventType, metadataSizes.TypeDefOrRefCodedIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:9,代码来源:MetadataBuilder.Tables.cs


示例14: SerializeEventMapTable

 private void SerializeEventMapTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (EventMapRow eventMap in _eventMapTable)
     {
         writer.WriteReference(eventMap.Parent, metadataSizes.TypeDefIndexSize);
         writer.WriteReference(eventMap.EventList, metadataSizes.EventDefIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:8,代码来源:MetadataBuilder.Tables.cs


示例15: SerializeStandAloneSigTable

 private void SerializeStandAloneSigTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (StandaloneSigRow row in _standAloneSigTable)
     {
         writer.WriteReference((uint)GetHeapOffset(row.Signature), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:7,代码来源:MetadataBuilder.Tables.cs


示例16: SerializeManifestResourceTable

 private void SerializeManifestResourceTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (ManifestResourceRow manifestResource in _manifestResourceTable)
     {
         writer.WriteUInt32(manifestResource.Offset);
         writer.WriteUInt32(manifestResource.Flags);
         writer.WriteReference((uint)GetHeapOffset(manifestResource.Name), metadataSizes.StringIndexSize);
         writer.WriteReference(manifestResource.Implementation, metadataSizes.ImplementationCodedIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:10,代码来源:MetadataBuilder.Tables.cs


示例17: SerializeNestedClassTable

        private void SerializeNestedClassTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _nestedClassTable.Count; i++)
            {
                Debug.Assert(_nestedClassTable[i - 1].NestedClass <= _nestedClassTable[i].NestedClass);
            }
#endif
            foreach (NestedClassRow nestedClass in _nestedClassTable)
            {
                writer.WriteReference(nestedClass.NestedClass, metadataSizes.TypeDefIndexSize);
                writer.WriteReference(nestedClass.EnclosingClass, metadataSizes.TypeDefIndexSize);
            }
        }
开发者ID:tzetang,项目名称:corefx,代码行数:14,代码来源:MetadataBuilder.Tables.cs


示例18: SerializeModuleRefTable

 private void SerializeModuleRefTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (ModuleRefRow moduleRef in _moduleRefTable)
     {
         writer.WriteReference((uint)GetHeapOffset(moduleRef.Name), metadataSizes.StringIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:7,代码来源:MetadataBuilder.Tables.cs


示例19: SerializeGenericParamConstraintTable

        private void SerializeGenericParamConstraintTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _genericParamConstraintTable.Count; i++)
            {
                Debug.Assert(_genericParamConstraintTable[i - 1].Owner <= _genericParamConstraintTable[i].Owner);
            }
#endif
            foreach (GenericParamConstraintRow genericParamConstraint in _genericParamConstraintTable)
            {
                writer.WriteReference(genericParamConstraint.Owner, metadataSizes.GenericParamIndexSize);
                writer.WriteReference(genericParamConstraint.Constraint, metadataSizes.TypeDefOrRefCodedIndexSize);
            }
        }
开发者ID:tzetang,项目名称:corefx,代码行数:14,代码来源:MetadataBuilder.Tables.cs


示例20: SerializeTypeSpecTable

 private void SerializeTypeSpecTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (TypeSpecRow typeSpec in _typeSpecTable)
     {
         writer.WriteReference((uint)GetHeapOffset(typeSpec.Signature), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:tzetang,项目名称:corefx,代码行数:7,代码来源:MetadataBuilder.Tables.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap