TypeBuilder.GetMethodImpl 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當導出類別被覆寫時,會搜尋指定方法,其參數與指定的參數類型與修飾符相符,並使用指定的綁定約束與呼叫慣例。
protected:
override System::Reflection::MethodInfo ^ GetMethodImpl(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, System::Reflection::CallingConventions callConvention, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected override System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)>]
override this.GetMethodImpl : string * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Protected Overrides Function GetMethodImpl (name As String, bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As MethodInfo
參數
- name
- String
包含要取得之方法名稱的字串。
- binder
- Binder
一個定義一組屬性並啟用綁定的物件,綁定可能涉及選擇超載方法、強制參數類型,以及透過反射呼叫成員。
-或-
一個null參考(Nothing,Visual Basic中),用來使用DefaultBinder。
- callConvention
- CallingConventions
指定參數順序與佈局、回傳值傳遞方式、參數使用暫存器,以及清理堆疊的程序的物件。
- types
- Type[]
Type 對象的陣列,表示要取得之方法的參數數目、順序和類型。
-或-
一個空陣列的 類型 Type (即 Type[] types = new Type[0]),以獲得一個不接受參數的方法。
-或-
null。 若 types 為 , null則 參數不匹配。
- modifiers
- ParameterModifier[]
一個代表陣列中對應元素ParameterModifier屬性的物件陣列types。 預設的綁定器不會處理這個參數。
傳回
物件,表示符合指定需求的方法,如果找到則為 ;否則,null。
- 屬性