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
moduleModuleDefinitionThe module to pull the original tokens from, or
nullif no verification should be done on the declaring module.
Methods
GetAssemblyReferenceToken(AssemblyReference, object?)
Gets the newly assigned metadata token of a assembly reference stored in a tables stream or tables stream buffer.
public MetadataToken GetAssemblyReferenceToken(AssemblyReference assembly, object? diagnosticSource = null)
Parameters
assemblyAssemblyReferenceThe reference to the assembly to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added assembly reference.
GetFieldDefinitionToken(FieldDefinition, object?)
Gets the newly assigned metadata token of a type definition stored in a tables stream or tables stream buffer.
public MetadataToken GetFieldDefinitionToken(FieldDefinition field, object? diagnosticSource = null)
Parameters
fieldFieldDefinitionThe reference to the field to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added field definition.
GetMemberReferenceToken(MemberReference, object?)
Gets the newly assigned metadata token of a member reference stored in a tables stream or tables stream buffer.
public MetadataToken GetMemberReferenceToken(MemberReference member, object? diagnosticSource = null)
Parameters
memberMemberReferenceThe reference to the member to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added member reference.
GetMethodDefinitionToken(MethodDefinition, object?)
Gets the newly assigned metadata token of a method definition stored in a tables stream or tables stream buffer.
public MetadataToken GetMethodDefinitionToken(MethodDefinition method, object? diagnosticSource = null)
Parameters
methodMethodDefinitionThe reference to the method to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added method definition.
GetMethodSpecificationToken(MethodSpecification, object?)
Gets the newly assigned metadata token of a method specification stored in a tables stream or tables stream buffer.
public MetadataToken GetMethodSpecificationToken(MethodSpecification method, object? diagnosticSource = null)
Parameters
methodMethodSpecificationThe reference to the method to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added method specification.
GetStandAloneSignatureToken(StandAloneSignature, object?)
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, object? diagnosticSource = null)
Parameters
signatureStandAloneSignatureThe reference to the signature to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added signature.
GetTypeDefinitionToken(TypeDefinition, object?)
Gets the newly assigned metadata token of a type definition stored in a tables stream or tables stream buffer.
public MetadataToken GetTypeDefinitionToken(TypeDefinition type, object? diagnosticSource = null)
Parameters
typeTypeDefinitionThe reference to the type to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added type definition.
GetTypeReferenceToken(TypeReference, object?)
Gets the newly assigned metadata token of a type reference stored in a tables stream or tables stream buffer.
public MetadataToken GetTypeReferenceToken(TypeReference type, object? diagnosticSource = null)
Parameters
typeTypeReferenceThe reference to the type to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
Returns
- MetadataToken
The metadata token of the added type reference.
GetTypeSpecificationToken(TypeSpecification, object?)
Gets the newly assigned metadata token of a type specification. stored in a tables stream or tables stream buffer.
public MetadataToken GetTypeSpecificationToken(TypeSpecification type, object? diagnosticSource = null)
Parameters
typeTypeSpecificationThe reference to the type to add.
diagnosticSourceobjectWhen available, the object that is reported in diagnostics when obtaining the token fails.
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
valuestringThe string value.
Returns
- uint
The index.