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
- object
- MetadataAdapter<Type>
- AttributeAwareMetadataAdapter<Type>
- MemberAdapter<Type>
- TypeAdapter
- TypeParameterAdapter
- 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
| Constraints | Gets the constraints applied to the type parameter. |
| DeclaringMember | Gets the member that declares this type parameter, which can be either a type or a method. |
| HasConstraints | Gets a value indicating whether the type parameter has any constraints. |
| IsDirectDeclaration | Gets a value indicating whether the member represents a direct declaration. |
| IsGenericMethodParameter | Gets a value indicating whether the current type parameter represents a type parameter of a generic method. |
| IsGenericTypeParameter | Gets a value indicating whether the current type parameter represents a type parameter of a generic type. |
| Name | Gets the name of the metadata element. |
| Position | Gets the position of the type parameter in the type parameter list. |
| TypeConstraints | Gets the type constraints applied to the type parameter. |
| Variance | Gets 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. |
