TypeBuilder.DefineMethodCore Metode

Definisi

Saat ditimpa di kelas turunan, menambahkan metode baru ke jenis , dengan nama, atribut metode, konvensi panggilan, tanda tangan metode, dan pengubah kustom yang ditentukan.

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

Parameter

name
String

Nama metode . name tidak boleh berisi null yang disematkan.

attributes
MethodAttributes

Kombinasi bitwise dari nilai enumerasi yang menentukan atribut metode .

callingConvention
CallingConventions

Konvensi pemanggilan metode.

returnType
Type

Jenis pengembalian metode .

returnTypeRequiredCustomModifiers
Type[]

Array jenis yang mewakili pengubah kustom yang diperlukan.

returnTypeOptionalCustomModifiers
Type[]

Array jenis yang mewakili pengubah kustom opsional.

parameterTypes
Type[]

Jenis parameter metode .

parameterTypeRequiredCustomModifiers
Type[][]

Array jenis array. Setiap array jenis mewakili pengubah kustom yang diperlukan untuk parameter yang sesuai.

parameterTypeOptionalCustomModifiers
Type[][]

Array jenis array. Setiap array jenis mewakili pengubah kustom opsional untuk parameter yang sesuai.

Mengembalikan

Objek MethodBuilder yang mewakili metode yang baru ditambahkan.

Berlaku untuk