TypeParameterAdapter Class

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

An adapter that wraps a Type representing a generic type parameter and provides metadata access.
public class TypeParameterAdapter : TypeAdapter, ITypeParameter
Inheritance
Implements

Remarks

This class serves as a bridge between the reflection-based Type and the metadata representation defined by the ITypeParameter interface. It provides access to generic type parameter-level information regardless of whether the assembly containing the type was loaded via Common Language Runtime (CLR) or Metadata Load Context (MLC).

Thread Safety

All public members of the type are guaranteed to be thread-safe.

Constructors

TypeParameterAdapter(IAssembly, Type)Initializes a new instance of the TypeParameterAdapter class.

Properties

ConstraintsGets the constraints applied to the type parameter.
DeclaringMemberGets the member that declares this type parameter, which can be either a type or a method.
HasConstraintsGets a value indicating whether the type parameter has any constraints.
IsDirectDeclarationGets a value indicating whether the member represents a direct declaration.
IsGenericMethodParameterGets a value indicating whether the current type parameter represents a type parameter of a generic method.
IsGenericTypeParameterGets a value indicating whether the current type parameter represents a type parameter of a generic type.
NameGets the name of the metadata element.
PositionGets the position of the type parameter in the type parameter list.
TypeConstraintsGets the type constraints applied to the type parameter.
VarianceGets the variance of the type parameter.

Methods

Accepts(ITypeParameter)Determines whether this type parameter accepts the specified type parameter as a valid substitution.
ConstructFullName()Constructs the full name of the type when Type.FullName is null.
ConstructSignature(bool)Constructs the signature of the type.
CreateAttributeMetadata(CustomAttributeData)Creates a custom attribute metadata instance for the given attribute data.
GetConstraintTypes()Retrieves the constraint types for the type parameter.
GetDeclaringMember()Retrieves the member (type or method) that declares the generic type parameter.
IsAssignableFrom(IType)Determines whether the instances of the specified type can be assigned to variables of the current type.
IsSubstitutableBy(IType)Determines whether the specified type as a parameter type can be substituted for the current type.

Extension Methods

GetInheritedMember(this IMember)Retrieves the member that this member directly inherits from.
GetMemberDefinition(this IMember)Retrieves the definition of the member, resolving any constructed or decorated forms to their underlying definitions.
GetMembers(this IType)Gets all members directly declared by the type, excluding nested types.
GetMembersIncludingNested(this IType)Gets all members of the type, including its nested types and their members at all nesting levels.
TryGetOwnTypeParameters(this IMember, out IEnumerable<ITypeParameter>)Attempts to get the type parameters declared directly by the specified member if it is generic.