Class CorLibTypeSignature
- Namespace
- AsmResolver.DotNet.Signatures
- Assembly
- AsmResolver.DotNet.dll
Represents a blob type signature referencing an element type defined in a common object runtime library such as mscorlib (.NET framework) or System.Private.CorLib (.NET Core).
public class CorLibTypeSignature : TypeSignature, ITypeDescriptor, IMemberDescriptor, IFullNameProvider, INameProvider, IModuleProvider, IImportable
- Inheritance
-
CorLibTypeSignature
- Implements
- Inherited Members
- Extension Methods
Properties
ElementType
Gets the element type of the
public override ElementType ElementType { get; }
Property Value
IsValueType
Gets a value indicating whether instances of this type are passed on by value or by reference.
public override bool IsValueType { get; }
Property Value
Name
Gets the name of the object.
public override string? Name { get; }
Property Value
Namespace
Gets the namespace the type resides in.
public override string Namespace { get; }
Property Value
Scope
Gets the resolution scope that defines the type.
public override IResolutionScope? Scope { get; }
Property Value
Type
Gets the reference to the type as it is defined in the common object runtime library.
public ITypeDefOrRef Type { get; }
Property Value
Methods
AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult>)
Visit the current type signature using the provided visitor.
public override TResult AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult> visitor)
Parameters
visitor
ITypeSignatureVisitor<TResult>The visitor to accept.
Returns
- TResult
The result the visitor produced after visiting this type signature.
Type Parameters
TResult
The type of result the visitor produces.
AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult>, TState)
Visit the current type signature using the provided visitor.
public override TResult AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult> visitor, TState state)
Parameters
visitor
ITypeSignatureVisitor<TState, TResult>The visitor to accept.
state
TStateAdditional state.
Returns
- TResult
The result the visitor produced after visiting this type signature.
Type Parameters
TState
The type of additional state.
TResult
The type of result the visitor produces.
GetIntermediateType()
Obtains the intermediate type of the type signature.
public override TypeSignature GetIntermediateType()
Returns
- TypeSignature
The intermediate type.
Remarks
As per ECMA-335 I.8.7, intermediate types are a subset of the built-in value types can be represented on the evaluation stack.
GetReducedType()
Obtains the reduced type of the type signature.
public override TypeSignature GetReducedType()
Returns
- TypeSignature
The reduced type.
Remarks
As per ECMA-335 I.8.7, the reduced type ignores the semantic differences between enumerations and the signed and unsigned integer types; treating these types the same if they have the same number of bits.
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.
GetVerificationType()
Obtains the verification type of the type signature.
public override TypeSignature GetVerificationType()
Returns
- TypeSignature
The verification type.
Remarks
As per ECMA-335 I.8.7, the verification type ignores the semantic differences between enumerations, characters, booleans, the signed and unsigned integer types, and managed pointers to any of these; treating these types the same if they have the same number of bits or point to types with the same number of bits.
IsImportedInModule(ModuleDefinition)
Determines whether the descriptor of the member is fully imported in the provided module.
public override bool IsImportedInModule(ModuleDefinition module)
Parameters
module
ModuleDefinitionThe 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()
Resolves the reference to a type definition.
public override TypeDefinition? Resolve()
Returns
- TypeDefinition
The resolved type definition, or
null
if the type could not be resolved.
Remarks
This method can only be invoked if the reference was added to a module.
ToTypeDefOrRef()
Transforms the type descriptor to an instance of a ITypeDefOrRef, which can be referenced by a metadata token.
public override ITypeDefOrRef ToTypeDefOrRef()
Returns
- ITypeDefOrRef
The constructed TypeDefOrRef instance.
WriteContents(in BlobSerializationContext)
Serializes the blob (without extra data) to an output stream.
protected override void WriteContents(in BlobSerializationContext context)
Parameters
context
BlobSerializationContext