Table of Contents

Class TypeSpecificationSignature

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Provides a base for type signatures that are based on another type signature.

public abstract class TypeSpecificationSignature : TypeSignature, ITypeDescriptor, IMemberDescriptor, IFullNameProvider, INameProvider, IModuleProvider, IImportable
Inheritance
TypeSpecificationSignature
Implements
Derived
Inherited Members
Extension Methods

Constructors

TypeSpecificationSignature(TypeSignature)

Initializes a new type specification.

protected TypeSpecificationSignature(TypeSignature baseType)

Parameters

baseType TypeSignature

The type to base the specification on.

Properties

BaseType

Gets the type this specification is based on.

public TypeSignature BaseType { get; set; }

Property Value

TypeSignature

ContextModule

Gets the module that defines the member definition or reference.

public override ModuleDefinition? ContextModule { get; }

Property Value

ModuleDefinition

Remarks

For member references, this does not obtain the module definition that the member is defined in. Rather, it obtains the module definition that references this reference.

Namespace

Gets the namespace the type resides in.

public override string? Namespace { get; }

Property Value

string

Scope

Gets the resolution scope that defines the type.

public override IResolutionScope? Scope { get; }

Property Value

IResolutionScope

Methods

GetUnderlyingTypeDefOrRef()

Gets the underlying base type signature, without any extra adornments.

public override ITypeDefOrRef? GetUnderlyingTypeDefOrRef()

Returns

ITypeDefOrRef

The base signature.

Remarks

This is not to be confused with GetUnderlyingType(), which may resolve enum types to their underlying type representation.

IsImportedInModule(ModuleDefinition)

Determines whether the descriptor of the member is fully imported in the provided module.

public override bool IsImportedInModule(ModuleDefinition module)

Parameters

module ModuleDefinition

The module that is supposed to import the member.

Returns

bool

true if the descriptor of the member is fully imported by the module, false otherwise.

Remarks

This method verifies all references in the descriptor of the member only. It does not verify any additional data or contents (such as a method body) associated to the member.

Resolve(ModuleDefinition)

Resolves the reference to a method definition, assuming the provided module as resolution context.

public override TypeDefinition? Resolve(ModuleDefinition context)

Parameters

context ModuleDefinition

The module to assume as resolution context.

Returns

TypeDefinition

The resolved method definition, or null if the method could not be resolved.

WriteBaseType(BlobSerializationContext)

Writes BaseType to the output stream.

protected void WriteBaseType(BlobSerializationContext context)

Parameters

context BlobSerializationContext

The output stream.

WriteContents(in BlobSerializationContext)

Serializes the blob (without extra data) to an output stream.

protected override void WriteContents(in BlobSerializationContext context)

Parameters

context BlobSerializationContext