TypeBuilder.DefineMethodCore 方法

定義

在衍生類別中覆寫時,使用指定的名稱、方法屬性、呼叫慣例、方法簽章和自訂修飾詞,將新的方法新增至類型。

protected:
 abstract System::Reflection::Emit::MethodBuilder ^ DefineMethodCore(System::String ^ name, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ returnTypeRequiredCustomModifiers, cli::array <Type ^> ^ returnTypeOptionalCustomModifiers, cli::array <Type ^> ^ parameterTypes, cli::array <cli::array <Type ^> ^> ^ parameterTypeRequiredCustomModifiers, cli::array <cli::array <Type ^> ^> ^ parameterTypeOptionalCustomModifiers);
protected abstract System.Reflection.Emit.MethodBuilder DefineMethodCore (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers);
abstract member DefineMethodCore : string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * Type[] * Type[] * Type[][] * Type[][] -> System.Reflection.Emit.MethodBuilder
Protected MustOverride Function DefineMethodCore (name As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, returnTypeRequiredCustomModifiers As Type(), returnTypeOptionalCustomModifiers As Type(), parameterTypes As Type(), parameterTypeRequiredCustomModifiers As Type()(), parameterTypeOptionalCustomModifiers As Type()()) As MethodBuilder

參數

name
String

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

attributes
MethodAttributes

列舉值的位元組合,指定 方法的屬性。

callingConvention
CallingConventions

方法的呼叫慣例。

returnType
Type

方法的傳回類型。

returnTypeRequiredCustomModifiers
Type[]

型別陣列,表示必要的自訂修飾詞。

returnTypeOptionalCustomModifiers
Type[]

型別陣列,表示選擇性自訂修飾詞。

parameterTypes
Type[]

方法的參數類型。

parameterTypeRequiredCustomModifiers
Type[][]

類型陣列的陣列。 每個類型的陣列都代表對應參數的必要自訂修飾詞。

parameterTypeOptionalCustomModifiers
Type[][]

類型陣列的陣列。 每一個型別陣列都表示對應參數的選擇性自訂修飾詞。

傳回

MethodBuilder 物件,代表新加入的方法。

適用於