Udostępnij przez


TypeBuilder.DefineMethodCore Metoda

Definicja

Po zastąpieniu w klasie pochodnej dodaje nową metodę do typu z określoną nazwą, atrybutami metody, konwencją wywoływania, sygnaturą metody i modyfikatorami niestandardowymi.

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

Parametry

name
String

Nazwa metody. name Program nie może zawierać osadzonych wartości null.

attributes
MethodAttributes

Bitowa kombinacja wartości wyliczenia, która określa atrybuty metody.

callingConvention
CallingConventions

Konwencja wywoływania metody.

returnType
Type

Zwracany typ metody.

returnTypeRequiredCustomModifiers
Type[]

Tablica typów reprezentujących wymagane modyfikatory niestandardowe.

returnTypeOptionalCustomModifiers
Type[]

Tablica typów reprezentujących opcjonalne modyfikatory niestandardowe.

parameterTypes
Type[]

Typy parametrów metody .

parameterTypeRequiredCustomModifiers
Type[][]

Tablica tablic typów. Każda tablica typów reprezentuje wymagane modyfikatory niestandardowe dla odpowiedniego parametru.

parameterTypeOptionalCustomModifiers
Type[][]

Tablica tablic typów. Każda tablica typów reprezentuje opcjonalne modyfikatory niestandardowe dla odpowiedniego parametru.

Zwraca

MethodBuilder Obiekt reprezentujący nowo dodaną metodę.

Dotyczy