System.Reflection.MethodBase.GetMethodFromHandle Method

Gets a System.Reflection.MethodBase object for the constructor or method represented by the specified handle, for the specified generic type.

Syntax

[System.Runtime.InteropServices.ComVisible(false)]
public static MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)

Parameters

handle
A handle to the internal metadata representation of a constructor or method.
declaringType
A handle to the generic type that defines the constructor or method.

Returns

A System.Reflection.MethodBase object representing the method or constructor specified by handle, in the generic type specified by declaringType.

Remarks

Handles are valid only in the application domain in which they were obtained.

A RuntimeMethodHandle structure for a constructor or method of a generic type can represent different System.Reflection.MethodBase objects, depending on the types specified for the type parameters of the generic type. For example, if class G<T> (class G(Of T) in Visual Basic, generic <T> ref class G in C++) has a method that returns type T, the System.Reflection.MethodBase object for that method in a constructed class such as G<int> is different from the System.Reflection.MethodBase object for that method in the generic type definition.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0