System.Reflection.Emit.ModuleBuilder.DefineGlobalMethod Method

Defines a global method with the specified name, attributes, return type, and parameter types.

Syntax

public MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, Type returnType, Type[] parameterTypes)

Parameters

name
The name of the method. name cannot contain embedded nulls.
attributes
The attributes of the method. attributes must include System.Reflection.MethodAttributes.Static.
returnType
The return type of the method.
parameterTypes
The types of the method's parameters.

Returns

The defined global method.

Remarks

The global method that this method defines is not usable until you call ModuleBuilder.CreateGlobalFunctions.

Note:

Starting with the net_v20sp1_long, this member no longer requires System.Security.Permissions.ReflectionPermission with the System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0