Class GenericParameterSignature
- Namespace
- AsmResolver.DotNet.Signatures
- Assembly
- AsmResolver.DotNet.dll
Represents a type signature that references a type argument from a generic type or method.
public class GenericParameterSignature : TypeSignature, ITypeDescriptor, IMemberDescriptor, IFullNameProvider, INameProvider, IModuleProvider, IImportable
- Inheritance
-
GenericParameterSignature
- Implements
- Inherited Members
- Extension Methods
Constructors
GenericParameterSignature(ModuleDefinition?, GenericParameterType, int)
Creates a new reference to a generic parameter.
public GenericParameterSignature(ModuleDefinition? module, GenericParameterType parameterType, int index)
Parameters
moduleModuleDefinitionThe module in which this generic parameter signature resides.
parameterTypeGenericParameterTypeIndicates the parameter signature is declared by a type or a method.
indexintThe index of the referenced parameter.
GenericParameterSignature(GenericParameterType, int)
Creates a new reference to a generic parameter.
public GenericParameterSignature(GenericParameterType parameterType, int index)
Parameters
parameterTypeGenericParameterTypeIndicates the parameter signature is declared by a type or a method.
indexintThe index of the referenced parameter.
Properties
ElementType
Gets the element type of the
public override ElementType ElementType { get; }
Property Value
Index
Gets or sets the index of the referenced generic parameter.
public int Index { get; set; }
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
ParameterType
Gets or sets a value indicating whether this parameter signature is declared by a type or a method. generic parameter.
public GenericParameterType ParameterType { get; set; }
Property Value
Scope
Gets the resolution scope that defines the type.
public override IResolutionScope? Scope { 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
visitorITypeSignatureVisitor<TResult>The visitor to accept.
Returns
- TResult
The result the visitor produced after visiting this type signature.
Type Parameters
TResultThe 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
visitorITypeSignatureVisitor<TState, TResult>The visitor to accept.
stateTStateAdditional state.
Returns
- TResult
The result the visitor produced after visiting this type signature.
Type Parameters
TStateThe type of additional state.
TResultThe type of result the visitor produces.
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
moduleModuleDefinitionThe module that is supposed to import the member.
Returns
- bool
trueif the descriptor of the member is fully imported by the module,falseotherwise.
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
contextModuleDefinitionThe module to assume as resolution context.
Returns
- TypeDefinition
The resolved method definition, or
nullif the method could not be resolved.
WriteContents(in BlobSerializationContext)
Serializes the blob (without extra data) to an output stream.
protected override void WriteContents(in BlobSerializationContext context)
Parameters
contextBlobSerializationContext