TypeAdapter Class

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

Definition

An abstract base class for adapters that wrap reflected types and provide metadata access.
public abstract class TypeAdapter : MemberAdapter<Type>, IType
Inheritance
Implements
Inherited by

Remarks

This class serves as a bridge between the reflection-based Type and the metadata representation defined by the IType interface. It provides access to type-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

TypeAdapter(object, Type)Initializes a new instance of the TypeAdapter class.

Properties

AssemblyGets the assembly that contains the member.
BaseTypeGets the base type of this type.
CodeReferenceGets the code reference for the member.
DeclaringTypeGets the declaring type of the member, if any.
FullNameGets the full name of the type.
IsGenericTypeGets a value indicating whether the type is a generic type.
IsNestedGets a value indicating whether the type is nested.
IsSpecialNameGets a value indicating whether the member is a special name.
IsStaticGets a value indicating whether the member is static.
IsUnsafeGets a value indicating whether this member is declared as unsafe.
IsValueTypeGets a value indicating whether the type is a value type.
NamespaceGets the namespace of the member.
ParametericSignatureGets the signature of the type when used as a parameter or return type.
SignatureGets the general signature of the type.

Methods

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.
Equals(IType)Determines whether the specified type is equal to this type based on their signatures.
Equals(object)Determines whether the specified object is equal to this type.
GetBaseType()Retrieves the metadata for the base type of the current type.
GetHashCode()Serves as the default hash function.
GetMemberVisibility()Retrieves the visibility of the member.
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.
Represents(Type)Determines whether this metadata adapter represents the specified reflection element.
ToString()Returns a string that represents the current object.

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.