MethodBase.GetMethodFromHandle 方法

定义

使用指定句柄获取方法信息。

重载

GetMethodFromHandle(RuntimeMethodHandle)

通过使用方法的内部元数据表示形式(句柄)获取方法信息。

GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)

以指定泛型类型,获取指定句柄所表示的构造函数或方法的 MethodBase 对象。

GetMethodFromHandle(RuntimeMethodHandle)

通过使用方法的内部元数据表示形式(句柄)获取方法信息。

public:
 static System::Reflection::MethodBase ^ GetMethodFromHandle(RuntimeMethodHandle handle);
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle);
public static System.Reflection.MethodBase? GetMethodFromHandle (RuntimeMethodHandle handle);
static member GetMethodFromHandle : RuntimeMethodHandle -> System.Reflection.MethodBase
Public Shared Function GetMethodFromHandle (handle As RuntimeMethodHandle) As MethodBase

参数

handle
RuntimeMethodHandle

方法的句柄。

返回

MethodBase,包含方法的有关信息。

例外

handle 无效。

注解

句柄仅在获取这些句柄的应用程序域中有效。

适用于

GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)

以指定泛型类型,获取指定句柄所表示的构造函数或方法的 MethodBase 对象。

public:
 static System::Reflection::MethodBase ^ GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
public static System.Reflection.MethodBase? GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
[System.Runtime.InteropServices.ComVisible(false)]
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
static member GetMethodFromHandle : RuntimeMethodHandle * RuntimeTypeHandle -> System.Reflection.MethodBase
[<System.Runtime.InteropServices.ComVisible(false)>]
static member GetMethodFromHandle : RuntimeMethodHandle * RuntimeTypeHandle -> System.Reflection.MethodBase
Public Shared Function GetMethodFromHandle (handle As RuntimeMethodHandle, declaringType As RuntimeTypeHandle) As MethodBase

参数

handle
RuntimeMethodHandle

构造函数或方法的内部元数据表示形式的句柄。

declaringType
RuntimeTypeHandle

定义构造函数或方法的泛型类型的句柄。

返回

MethodBase 对象,表示由 handle 指定的方法或构造函数,为由 declaringType 指定的泛型类型。

属性

例外

handle 无效。

注解

句柄仅在获取这些句柄的应用程序域中有效。

RuntimeMethodHandle泛型类型的构造函数或方法的结构可以表示不同的MethodBase对象,具体取决于为泛型类型的类型参数指定的类型。 例如,如果在 class G<T> Visual Basic 中 (class G(Of T)generic <T> ref class G 在 C++) 中具有返回类型 T的方法, MethodBase 则构造类(如 ) G<int> 中该方法的对象与 MethodBase 泛型类型定义中该方法的对象不同。

适用于