當前位置: 首頁>>代碼示例>>C#>>正文


C# BlobBuilder.WriteReference方法代碼示例

本文整理匯總了C#中BlobBuilder.WriteReference方法的典型用法代碼示例。如果您正苦於以下問題:C# BlobBuilder.WriteReference方法的具體用法?C# BlobBuilder.WriteReference怎麽用?C# BlobBuilder.WriteReference使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BlobBuilder的用法示例。


在下文中一共展示了BlobBuilder.WriteReference方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SerializeStandAloneSigTable

 private void SerializeStandAloneSigTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (StandaloneSigRow row in _standAloneSigTable)
     {
         writer.WriteReference((uint)GetHeapOffset(row.Signature), metadataSizes.BlobIndexSize);
     }
 }
開發者ID:MichalStrehovsky,項目名稱:corefx,代碼行數:7,代碼來源:MetadataBuilder.Tables.cs

示例2: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:14,代碼來源:MetadataBuilder.Tables.cs

示例3: SerializeDocumentTable

 private void SerializeDocumentTable(BlobBuilder writer, Sizes sizes)
 {
     foreach (var row in _documentTable)
     {
         writer.WriteReference(MetadataTokens.GetHeapOffset(row.Name), isSmall: (sizes.BlobIndexSize == 2));
         writer.WriteReference(MetadataTokens.GetHeapOffset(row.HashAlgorithm), isSmall: (sizes.GuidIndexSize == 2));
         writer.WriteReference(MetadataTokens.GetHeapOffset(row.Hash), isSmall: (sizes.BlobIndexSize == 2));
     }
 }
開發者ID:Rickinio,項目名稱:roslyn,代碼行數:9,代碼來源:MetadataWriter.DynamicAnalysis.cs

示例4: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:27,代碼來源:MetadataBuilder.Tables.cs

示例5: SerializeLocalConstantTable

 private void SerializeLocalConstantTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _localConstantTable)
     {
         writer.WriteReference((uint)GetHeapOffset(row.Name), metadataSizes.StringIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.Signature), metadataSizes.BlobIndexSize);
     }
 }
開發者ID:MichalStrehovsky,項目名稱:corefx,代碼行數:8,代碼來源:MetadataBuilder.Tables.cs

示例6: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:14,代碼來源:MetadataBuilder.Tables.cs

示例7: SerializeDocumentTable

 private void SerializeDocumentTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (var row in _documentTable)
     {
         writer.WriteReference((uint)GetHeapOffset(row.Name), metadataSizes.BlobIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.HashAlgorithm), metadataSizes.GuidIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.Hash), metadataSizes.BlobIndexSize);
         writer.WriteReference((uint)GetHeapOffset(row.Language), metadataSizes.GuidIndexSize);
     }
 }
開發者ID:MichalStrehovsky,項目名稱:corefx,代碼行數:10,代碼來源:MetadataBuilder.Tables.cs

示例8: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:15,代碼來源:MetadataBuilder.Tables.cs

示例9: SerializeModuleRefTable

 private void SerializeModuleRefTable(BlobBuilder writer, MetadataSizes metadataSizes)
 {
     foreach (ModuleRefRow moduleRef in _moduleRefTable)
     {
         writer.WriteReference((uint)GetHeapOffset(moduleRef.Name), metadataSizes.StringIndexSize);
     }
 }
開發者ID:MichalStrehovsky,項目名稱:corefx,代碼行數:7,代碼來源:MetadataBuilder.Tables.cs

示例10: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:9,代碼來源:MetadataBuilder.Tables.cs

示例11: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:13,代碼來源: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:MichalStrehovsky,項目名稱: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:MichalStrehovsky,項目名稱: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:MichalStrehovsky,項目名稱:corefx,代碼行數:8,代碼來源:MetadataBuilder.Tables.cs

示例15: 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:MichalStrehovsky,項目名稱:corefx,代碼行數:14,代碼來源:MetadataBuilder.Tables.cs


注:本文中的BlobBuilder.WriteReference方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。