DynamicMethod Constructor (String, Type, Type, Module, Boolean)
Assembly: mscorlib (in mscorlib.dll)
public DynamicMethod ( string name, Type returnType, Type parameterTypes, Module m, bool skipVisibility )
public DynamicMethod ( String name, Type returnType, Type parameterTypes, Module m, boolean skipVisibility )
public function DynamicMethod ( name : String, returnType : Type, parameterTypes : Type, m : Module, skipVisibility : boolean )
The name of the dynamic method. Can be a zero-length string, but not a null reference (Nothing in Visual Basic).
A Type object that specifies the return type of the dynamic method, or a null reference (Nothing in Visual Basic) if the method has no return type.
An array of Type objects specifying the types of the parameters of the dynamic method, or a null reference (Nothing in Visual Basic) if the method has no parameters.
A Module representing the module with which the dynamic method is to be logically associated.
true to skip JIT visibility checks on members of all the types in all modules; otherwise, false.
An element of parameterTypes is a null reference (Nothing in Visual Basic) or Void.
name is a null reference (Nothing in Visual Basic).
m is a null reference (Nothing in Visual Basic).
returnType is a type for which Type.IsByRef returns true.
The dynamic method created with this constructor has access to public and internal (Friend in Visual Basic) members of all the types in contained module m. Skipping the JIT compiler's visibility checks allows the dynamic method to access private and protected members of all the types in the module, as well. This is useful when writing code to serialize objects, for example.
- ReflectionPermission to emit code. Associated enumeration: ReflectionPermissionFlag.ReflectionEmit.
- SecurityPermission to control evidence, if associated with a module other than the calling module. Associated enumeration: SecurityPermissionFlag.ControlEvidence.
- ReflectionPermission to skip JIT visibility checks, if skipVisibility is true. Associated enumeration: ReflectionPermissionFlag.MemberAccess.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.