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


C# BlobBuilder.WriteReference方法代码示例

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


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

示例1: SerializeClassLayoutTable

        private void SerializeClassLayoutTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _classLayoutTable.Count; i++)
            {
                Debug.Assert(_classLayoutTable[i - 1].Parent < _classLayoutTable[i].Parent);
            }
#endif
            foreach (ClassLayoutRow classLayout in _classLayoutTable)
            {
                writer.WriteUInt16(classLayout.PackingSize);
                writer.WriteUInt32(classLayout.ClassSize);
                writer.WriteReference(classLayout.Parent, metadataSizes.TypeDefIndexSize);
            }
        }
开发者ID:rgani,项目名称:roslyn,代码行数:15,代码来源:MetadataTablesBuilder.cs

示例2: SerializeLocalConstantTable

 private void SerializeLocalConstantTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _localConstantTable)
     {
         writer.WriteReference((uint)_debugHeapsOpt.ResolveStringIndex(row.Name), metadataSizes.StringIndexSize);
         writer.WriteReference((uint)_debugHeapsOpt.ResolveBlobIndex(row.Signature), metadataSizes.BlobIndexSize);
     }
 }
开发者ID:rgani,项目名称:roslyn,代码行数:8,代码来源:MetadataTablesBuilder.cs

示例3: SerializeStateMachineMethodTable

        private void SerializeStateMachineMethodTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _stateMachineMethodTable.Count; i++)
            {
                Debug.Assert(_stateMachineMethodTable[i - 1].MoveNextMethod < _stateMachineMethodTable[i].MoveNextMethod);
            }
#endif
            foreach (var row in _stateMachineMethodTable)
            {
                writer.WriteReference(row.MoveNextMethod, metadataSizes.MethodDefIndexSize);
                writer.WriteReference(row.KickoffMethod, metadataSizes.MethodDefIndexSize);
            }
        }
开发者ID:rgani,项目名称:roslyn,代码行数:14,代码来源:MetadataTablesBuilder.cs

示例4: SerializeDocumentTable

 private void SerializeDocumentTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _documentTable)
     {
         writer.WriteReference((uint)_debugHeapsOpt.ResolveBlobIndex(row.Name), metadataSizes.BlobIndexSize);
         writer.WriteReference(row.HashAlgorithm, metadataSizes.GuidIndexSize);
         writer.WriteReference((uint)_debugHeapsOpt.ResolveBlobIndex(row.Hash), metadataSizes.BlobIndexSize);
         writer.WriteReference(row.Language, metadataSizes.GuidIndexSize);
     }
 }
开发者ID:rgani,项目名称:roslyn,代码行数:10,代码来源:MetadataTablesBuilder.cs

示例5: SerializeLocalScopeTable

        private void SerializeLocalScopeTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            // Spec: The table is required to be sorted first by Method in ascending order, then by StartOffset in ascending order, then by Length in descending order.
            for (int i = 1; i < _localScopeTable.Count; i++)
            {
                Debug.Assert(_localScopeTable[i - 1].Method <= _localScopeTable[i].Method);
                if (_localScopeTable[i - 1].Method == _localScopeTable[i].Method)
                {
                    Debug.Assert(_localScopeTable[i - 1].StartOffset <= _localScopeTable[i].StartOffset);
                    if (_localScopeTable[i - 1].StartOffset == _localScopeTable[i].StartOffset)
                    {
                        Debug.Assert(_localScopeTable[i - 1].Length >= _localScopeTable[i].Length);
                    }
                }
            }
#endif
            foreach (var row in _localScopeTable)
            {
                writer.WriteReference(row.Method, metadataSizes.MethodDefIndexSize);
                writer.WriteReference(row.ImportScope, metadataSizes.ImportScopeIndexSize);
                writer.WriteReference(row.VariableList, metadataSizes.LocalVariableIndexSize);
                writer.WriteReference(row.ConstantList, metadataSizes.LocalConstantIndexSize);
                writer.WriteUInt32(row.StartOffset);
                writer.WriteUInt32(row.Length);
            }
        }
开发者ID:rgani,项目名称:roslyn,代码行数:27,代码来源:MetadataTablesBuilder.cs

示例6: 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:rgani,项目名称:roslyn,代码行数:14,代码来源:MetadataTablesBuilder.cs

示例7: 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:rgani,项目名称:roslyn,代码行数:14,代码来源:MetadataTablesBuilder.cs

示例8: SerializePropertyTable

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

示例9: 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 ? _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:rgani,项目名称:roslyn,代码行数:13,代码来源:MetadataTablesBuilder.cs

示例10: SerializeEventTable

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

示例11: 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:rgani,项目名称:roslyn,代码行数:8,代码来源:MetadataTablesBuilder.cs

示例12: 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:rgani,项目名称:roslyn,代码行数:8,代码来源:MetadataTablesBuilder.cs

示例13: SerializeStandAloneSigTable

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

示例14: SerializeFieldLayoutTable

        private void SerializeFieldLayoutTable(BlobBuilder writer, MetadataSizes metadataSizes)
        {
#if DEBUG
            for (int i = 1; i < _fieldLayoutTable.Count; i++)
            {
                Debug.Assert(_fieldLayoutTable[i - 1].Field < _fieldLayoutTable[i].Field);
            }
#endif
            foreach (FieldLayoutRow fieldLayout in _fieldLayoutTable)
            {
                writer.WriteUInt32(fieldLayout.Offset);
                writer.WriteReference(fieldLayout.Field, metadataSizes.FieldDefIndexSize);
            }
        }
开发者ID:rgani,项目名称:roslyn,代码行数:14,代码来源:MetadataTablesBuilder.cs

示例15: SerializeExportedTypeTable

 private void SerializeExportedTypeTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (ExportedTypeRow exportedType in _exportedTypeTable)
     {
         writer.WriteUInt32((uint)exportedType.Flags);
         writer.WriteUInt32(exportedType.TypeDefId);
         writer.WriteReference((uint)_heaps.ResolveStringIndex(exportedType.TypeName), metadataSizes.StringIndexSize);
         writer.WriteReference((uint)_heaps.ResolveStringIndex(exportedType.TypeNamespace), metadataSizes.StringIndexSize);
         writer.WriteReference(exportedType.Implementation, metadataSizes.ImplementationCodedIndexSize);
     }
 }
开发者ID:rgani,项目名称:roslyn,代码行数:11,代码来源:MetadataTablesBuilder.cs


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