ModuleBuilder.GetMethodImpl 方法

定義

傳回符合指定之準則的模組層級方法。

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);
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);
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);
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

方法名稱。

bindingAttr
BindingFlags

用來控制搜尋的 BindingFlags 位元旗標組合。

binder
Binder

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

callConvention
CallingConventions

方法的呼叫慣例。

types
Type[]

方法的參數型別。

modifiers
ParameterModifier[]

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

傳回

在模組層級上定義而且符合指定之準則的方法,如果這類方法不存在則為 null

例外狀況

namenulltypesnull,或 types 的項目為 null

備註

這個方法會提供繼承 Module.GetMethod 方法之所有多載的實作。 使用繼承 Module.GetMethod 的方法取得已在模組層級宣告的方法。 模組層級方法是使用 DefineGlobalMethod 方法在發出的程式代碼中定義。

重要

在呼叫模組的方法之後, CreateGlobalFunctions 才能擷取模組層級的方法。

適用於

另請參閱