AccessibleObject.IReflect.GetMethod 方法

定義

多載

IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

使用 Type 陣列從多載方法中選擇,取得對應到指定方法的 MethodInfo 物件。 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

IReflect.GetMethod(String, BindingFlags)

取得 MethodInfo 物件,其會對應到指定搜尋條件約束下的指定方法。 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags)

IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

使用 Type 陣列從多載方法中選擇,取得對應到指定方法的 MethodInfo 物件。 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

 virtual System::Reflection::MethodInfo ^ System.Reflection.IReflect.GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers) = System::Reflection::IReflect::GetMethod;
System.Reflection.MethodInfo IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type[] types, System.Reflection.ParameterModifier[] modifiers);
System.Reflection.MethodInfo? IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, Type[] types, System.Reflection.ParameterModifier[]? modifiers);
abstract member System.Reflection.IReflect.GetMethod : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
override this.System.Reflection.IReflect.GetMethod : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Function GetMethod (name As String, bindingAttr As BindingFlags, binder As Binder, types As Type(), modifiers As ParameterModifier()) As MethodInfo Implements IReflect.GetMethod

參數

name
String

要尋找的成員名稱。

bindingAttr
BindingFlags

繫結屬性,用來控制搜尋。

binder
Binder

該物件會實作 Binder,其中包含與此方法相關的屬性。

types
Type[]

陣列,用來在多載方法中選擇。

modifiers
ParameterModifier[]

參數修飾詞的陣列,用來進行與參數簽章的繫結工作,其中該參數簽章的類別已修改。

傳回

要求方法,符合所有指定參數。

實作

例外狀況

物件會使用相同名稱,實作多重方法。

備註

傳回值是根據方法名稱、 System.Reflection.BindingFlags 列舉、參數所指定的 binder 類型轉換種類、多載,以及 System.Reflection.ParameterInfo 描述方法簽章的 相符專案。

這個成員是明確介面成員實作, 只有在 AccessibleObject 執行個體轉換成 IReflect 介面時,才能使用這個成員。

適用於

IReflect.GetMethod(String, BindingFlags)

取得 MethodInfo 物件,其會對應到指定搜尋條件約束下的指定方法。 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags)

 virtual System::Reflection::MethodInfo ^ System.Reflection.IReflect.GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr) = System::Reflection::IReflect::GetMethod;
System.Reflection.MethodInfo IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr);
System.Reflection.MethodInfo? IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr);
abstract member System.Reflection.IReflect.GetMethod : string * System.Reflection.BindingFlags -> System.Reflection.MethodInfo
override this.System.Reflection.IReflect.GetMethod : string * System.Reflection.BindingFlags -> System.Reflection.MethodInfo
Function GetMethod (name As String, bindingAttr As BindingFlags) As MethodInfo Implements IReflect.GetMethod

參數

name
String

要尋找的成員名稱。

bindingAttr
BindingFlags

繫結屬性,用來控制搜尋。

傳回

MethodInfo 物件,包含方法資訊,並且符合是根據 bindingAttr 中所指定的方法名稱和搜尋條件約束。

實作

例外狀況

物件會使用相同名稱,實作多重方法。

備註

這個成員是明確介面成員實作, 只有在 AccessibleObject 執行個體轉換成 IReflect 介面時,才能使用這個成員。

適用於