MethodBase.GetMethodFromHandle 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
利用指定的 handle 取得方法資訊。
多載
| 名稱 | Description |
|---|---|
| GetMethodFromHandle(RuntimeMethodHandle) |
透過方法的內部元資料表示(handle)取得方法資訊。 |
| GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) |
取得 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);
[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,則該方法在建構類別(如 G<int> 中,MethodBase 物件與該方法的 MethodBase 物件在通用型別定義中不同。