Table of Contents

Class OriginalMetadataTokenProvider

Namespace
AsmResolver.DotNet.Code.Cil
Assembly
AsmResolver.DotNet.dll

Provides an implementation for the IMetadataTokenProvider interface that always returns the original metadata token that was assigned to the provided metadata member or string.

public class OriginalMetadataTokenProvider : IMetadataTokenProvider
Inheritance
OriginalMetadataTokenProvider
Implements
Inherited Members

Constructors

OriginalMetadataTokenProvider(ModuleDefinition?)

Creates a new token provider.

public OriginalMetadataTokenProvider(ModuleDefinition? module)

Parameters

module ModuleDefinition

The module to pull the original tokens from, or null if no verification should be done on the declaring module.

Methods

GetAssemblyReferenceToken(AssemblyReference)

Gets the newly assigned metadata token of a assembly reference stored in a tables stream or tables stream buffer.

public MetadataToken GetAssemblyReferenceToken(AssemblyReference assembly)

Parameters

assembly AssemblyReference

The reference to the assembly to add.

Returns

MetadataToken

The metadata token of the added assembly reference.

GetFieldDefinitionToken(FieldDefinition)

Gets the newly assigned metadata token of a type definition stored in a tables stream or tables stream buffer.

public MetadataToken GetFieldDefinitionToken(FieldDefinition field)

Parameters

field FieldDefinition

The reference to the field to add.

Returns

MetadataToken

The metadata token of the added field definition.

GetMemberReferenceToken(MemberReference)

Gets the newly assigned metadata token of a member reference stored in a tables stream or tables stream buffer.

public MetadataToken GetMemberReferenceToken(MemberReference member)

Parameters

member MemberReference

The reference to the member to add.

Returns

MetadataToken

The metadata token of the added member reference.

GetMethodDefinitionToken(MethodDefinition)

Gets the newly assigned metadata token of a method definition stored in a tables stream or tables stream buffer.

public MetadataToken GetMethodDefinitionToken(MethodDefinition method)

Parameters

method MethodDefinition

The reference to the method to add.

Returns

MetadataToken

The metadata token of the added method definition.

GetMethodSpecificationToken(MethodSpecification)

Gets the newly assigned metadata token of a method specification stored in a tables stream or tables stream buffer.

public MetadataToken GetMethodSpecificationToken(MethodSpecification method)

Parameters

method MethodSpecification

The reference to the method to add.

Returns

MetadataToken

The metadata token of the added method specification.

GetStandAloneSignatureToken(StandAloneSignature)

Gets the newly assigned metadata token of a stand-alone signature stored in a tables stream or tables stream buffer.

public MetadataToken GetStandAloneSignatureToken(StandAloneSignature signature)

Parameters

signature StandAloneSignature

The reference to the signature to add.

Returns

MetadataToken

The metadata token of the added signature.

GetTypeDefinitionToken(TypeDefinition)

Gets the newly assigned metadata token of a type definition stored in a tables stream or tables stream buffer.

public MetadataToken GetTypeDefinitionToken(TypeDefinition type)

Parameters

type TypeDefinition

The reference to the type to add.

Returns

MetadataToken

The metadata token of the added type definition.

GetTypeReferenceToken(TypeReference)

Gets the newly assigned metadata token of a type reference stored in a tables stream or tables stream buffer.

public MetadataToken GetTypeReferenceToken(TypeReference type)

Parameters

type TypeReference

The reference to the type to add.

Returns

MetadataToken

The metadata token of the added type reference.

GetTypeSpecificationToken(TypeSpecification)

Gets the newly assigned metadata token of a type specification. stored in a tables stream or tables stream buffer.

public MetadataToken GetTypeSpecificationToken(TypeSpecification type)

Parameters

type TypeSpecification

The reference to the type to add.

Returns

MetadataToken

The metadata token of the added type specification.

GetUserStringIndex(string)

Gets the index to a user-string referenced in a CIL method body.

public uint GetUserStringIndex(string value)

Parameters

value string

The string value.

Returns

uint

The index.