MethodAdapter Class

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

Definition

An adapter that wraps a MethodInfo and provides metadata access.
public class MethodAdapter : VirtualTypeMemberAdapter<MethodInfo>, IMethod
Inheritance
Implements

Remarks

This class serves as a bridge between the reflection-based MethodInfo and the metadata representation defined by the IMethod interface. It provides access to method-level information regardless of whether the assembly containing the method's 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

MethodAdapter(IType, MethodInfo)Initializes a new instance of the MethodAdapter class.

Properties

ImplementedMethodGets the interface method that this method implements, if any.
IsAsyncGets a value indicating whether the method is asynchronous.
IsExtensionGets a value indicating whether the method is an extension method.
IsGenericMethodGets a value indicating whether the method is generic.
IsReadOnlyGets a value indicating whether the method is read-only.
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.
OverloadsGets all the overloads of the member, excluding the member itself.
OverriddenMethodGets the base method that this method overrides, if any.
ParametersGets all the parameters declared by the member.
ReturnGets the return parameter of the member.
TypeParametersGets the type parameters declared by the method if it is generic.

Methods

FindGenericDefinition()Searches for the generic definition of this member if it is a constructed generic member.
FindImplementedMember()Searches the implemented interfaces for a member that this member implements.
FindOverriddenMember()Searches the base types for a member that this member overrides.
GetCodeReferenceParts()Retrieves the code reference parts for this member.
GetMemberVirtuality()Retrieves the virtuality of the member.
GetMemberVisibility()Retrieves the visibility of the member.
GetParameters()Retrieves the parameters of the method.
GetReturnParameter()Retrieves the return parameter of the method.
GetTypeParameters()Retrieves the type parameters defined by the method.
HasMatchingSignature(IMethod)Determines whether the given method can be considered a base declaration of this method.

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.
TryGetOwnTypeParameters(this IMember, out IEnumerable<ITypeParameter>)Attempts to get the type parameters declared directly by the specified member if it is generic.