MethodBase.GetMethodFromHandle 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的句柄获取方法信息。
重载
| 名称 | 说明 |
|---|---|
| GetMethodFromHandle(RuntimeMethodHandle) |
使用方法的内部元数据表示形式(句柄)获取方法信息。 |
| GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) |
MethodBase为指定的泛型类型获取由指定句柄表示的构造函数或方法的对象。 |
GetMethodFromHandle(RuntimeMethodHandle)
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
使用方法的内部元数据表示形式(句柄)获取方法信息。
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)
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
- Source:
- MethodBase.CoreCLR.cs
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)) 具有返回类型 T 的方法,则构造类(如 MethodBase)中该方法的 G<int> 对象与泛型类型定义中该方法的 MethodBase 对象不同。