AccessibleObject.IReflect.GetMethod 方法

定義

多載

IReflect.GetMethod(String, BindingFlags)

取得 MethodInfo 物件,其會對應到指定搜尋條件約束下的指定方法。Gets a MethodInfo object corresponding to a specified method under specified search constraints. 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags)For a description of this member, see GetMethod(String, BindingFlags).

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

使用 Type 陣列從多載方法中選擇,取得對應到指定方法的 MethodInfo 物件。Gets a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods. 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])For a description of this member, see GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]).

IReflect.GetMethod(String, BindingFlags)

取得 MethodInfo 物件,其會對應到指定搜尋條件約束下的指定方法。Gets a MethodInfo object corresponding to a specified method under specified search constraints. 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags)For a description of this member, see 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);
Function GetMethod (name As String, bindingAttr As BindingFlags) As MethodInfo Implements IReflect.GetMethod

參數

name
String

要尋找的成員名稱。The name of the member to find.

bindingAttr
BindingFlags

繫結屬性,用來控制搜尋。The binding attributes used to control the search.

傳回

MethodInfo 物件,包含方法資訊,並且符合是根據 bindingAttr 中所指定的方法名稱和搜尋條件約束。A MethodInfo object containing the method information, with the match being based on the method name and search constraints specified in bindingAttr.

實作

例外狀況

物件會使用相同名稱,實作多重方法。The object implements multiple methods with the same name.

備註

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 AccessibleObject 執行個體轉換成 IReflect 介面時,才能使用這個成員。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

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

使用 Type 陣列從多載方法中選擇,取得對應到指定方法的 MethodInfo 物件。Gets a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods. 如需這個成員的說明,請參閱 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])For a description of this member, see 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);

參數

name
String

要尋找的成員名稱。The name of the member to find.

bindingAttr
BindingFlags

繫結屬性,用來控制搜尋。The binding attributes used to control the search.

binder
Binder

該物件會實作 Binder,其中包含與此方法相關的屬性。An object that implements Binder, containing properties related to this method.

types
Type[]

陣列,用來在多載方法中選擇。An array used to choose among overloaded methods.

modifiers
ParameterModifier[]

參數修飾詞的陣列,用來進行與參數簽章的繫結工作,其中該參數簽章的類別已修改。An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

傳回

要求方法,符合所有指定參數。The requested method that matches all the specified parameters.

實作

例外狀況

物件會使用相同名稱,實作多重方法。The object implements multiple methods with the same name.

備註

傳回值是根據方法名稱、System.Reflection.BindingFlags 列舉、由 binder 參數所指定的類型轉換種類、多載,以及描述該方法簽章的 System.Reflection.ParameterInfo 的相符項。The return value is a match based on the method name, the System.Reflection.BindingFlags enumeration, the kind of type conversion specified by the binder parameter, the overload, and the System.Reflection.ParameterInfo that describes the signature of the method.

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 AccessibleObject 執行個體轉換成 IReflect 介面時,才能使用這個成員。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

適用於