ScriptObject.GetMethod 方法

定義

取得具有指定之名稱的方法。

多載

GetMethod(String, BindingFlags)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

取得具有指定之名稱的方法。

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

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

藉由使用指定的選取準則,取得具有指定之名稱的方法。

GetMethod(String, BindingFlags)

取得具有指定之名稱的方法。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

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

參數

name
String

要取得之方法的名稱。

bindingAttr
BindingFlags

列舉值的位元組合,指定透過反映處理搜尋成員的方式。

傳回

具有指定之 name 的方法,如果指令碼物件不包含方法則為 null。

實作

另請參閱

適用於

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

藉由使用指定的選取準則,取得具有指定之名稱的方法。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

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

參數

name
String

要搜尋的方法名稱。

bindingAttr
BindingFlags

列舉值的位元組合,指定透過反映處理搜尋成員的方式。

binder
Binder

將型別從實質引數型別轉換成型式引數型別的物件。

types
Type[]

用來找出相符方法的參數型別。

modifiers
ParameterModifier[]

參數修飾詞的陣列,啟用繫結以使用型別已被修改的參數簽章。

傳回

具有指定之 name 的方法,如果指令碼物件不包含方法則為 null。

實作

另請參閱

適用於