ScriptObject.GetMethod 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會得到一個有指定名稱的方法。
多載
| 名稱 | Description |
|---|---|
| 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 的方法。