TypeBuilder.DefineMethodCore Method

Definition

When overridden in a derived class, adds a new method to the type, with the specified name, method attributes, calling convention, method signature, and custom modifiers.

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

Parameters

name
String

The name of the method. name cannot contain embedded nulls.

attributes
MethodAttributes

A bitwise combination of the enumeration values that specifies the attributes of the method.

callingConvention
CallingConventions

The calling convention of the method.

returnType
Type

The return type of the method.

returnTypeRequiredCustomModifiers
Type[]

An array of types representing the required custom modifiers.

returnTypeOptionalCustomModifiers
Type[]

An array of types representing the optional custom modifiers.

parameterTypes
Type[]

The types of the parameters of the method.

parameterTypeRequiredCustomModifiers
Type[][]

An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter.

parameterTypeOptionalCustomModifiers
Type[][]

An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter.

Returns

A MethodBuilder object representing the newly added method.

Applies to