ModuleBuilder.DefineGlobalMethodCore 方法

定義

在衍生類別中覆寫時,使用指定的名稱、屬性、呼叫慣例、傳回型別、傳回型別的自定義修飾詞,以及參數類型的自定義修飾詞來定義全域方法。

protected:
 abstract System::Reflection::Emit::MethodBuilder ^ DefineGlobalMethodCore(System::String ^ name, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ requiredReturnTypeCustomModifiers, cli::array <Type ^> ^ optionalReturnTypeCustomModifiers, cli::array <Type ^> ^ parameterTypes, cli::array <cli::array <Type ^> ^> ^ requiredParameterTypeCustomModifiers, cli::array <cli::array <Type ^> ^> ^ optionalParameterTypeCustomModifiers);
protected abstract System.Reflection.Emit.MethodBuilder DefineGlobalMethodCore (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers);
abstract member DefineGlobalMethodCore : string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * Type[] * Type[] * Type[][] * Type[][] -> System.Reflection.Emit.MethodBuilder
Protected MustOverride Function DefineGlobalMethodCore (name As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, requiredReturnTypeCustomModifiers As Type(), optionalReturnTypeCustomModifiers As Type(), parameterTypes As Type(), requiredParameterTypeCustomModifiers As Type()(), optionalParameterTypeCustomModifiers As Type()()) As MethodBuilder

參數

name
String

方法的名稱。 name 不能包含內嵌 null 字元。

attributes
MethodAttributes

列舉值的位元組合,指定 方法的屬性。 屬性必須包含 Static

callingConvention
CallingConventions

方法的呼叫慣例。

returnType
Type

方法的傳回類型。

requiredReturnTypeCustomModifiers
Type[]

型別的陣列,表示傳回型別的必要自定義修飾詞。

optionalReturnTypeCustomModifiers
Type[]

型別的數位,表示傳回型別的選擇性自定義修飾詞。

parameterTypes
Type[]

方法參數的類型。

requiredParameterTypeCustomModifiers
Type[][]

類型陣列的陣列。 每一個型別陣列都表示全域方法之對應參數的必要自訂修飾詞。

optionalParameterTypeCustomModifiers
Type[][]

類型陣列的陣列。 每個型別數位都代表全域方法對應參數的選擇性自定義修飾詞。

傳回

已定義的全域方法。

適用於