ILGenerator.EmitCalli Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Puts a Calli instruction onto the Microsoft intermediate language (MSIL) stream, specifying a managed calling convention for the indirect call.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

Public Overridable Sub EmitCalli ( _
    opcode As OpCode, _
    callingConvention As CallingConventions, _
    returnType As Type, _
    parameterTypes As Type(), _
    optionalParameterTypes As Type() _
)
public virtual void EmitCalli(
    OpCode opcode,
    CallingConventions callingConvention,
    Type returnType,
    Type[] parameterTypes,
    Type[] optionalParameterTypes
)

Parameters

  • parameterTypes
    Type: array<System..::.Type>[]()[]
    The types of the required arguments to the instruction.
  • optionalParameterTypes
    Type: array<System..::.Type>[]()[]
    The types of the optional arguments for varargs calls.

Exceptions

Exception Condition
InvalidOperationException

optionalParameterTypes is not nullNothingnullptra null reference (Nothing in Visual Basic), but callingConvention does not include the CallingConventions..::.VarArgs flag.

Remarks

Use EmitCalli to put a Calli instruction onto the stream. Do not use Emit.

If optionalParameterTypes specifies optional arguments, callingConvention must include the CallingConventions..::.VarArgs flag.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also

Reference

ILGenerator Class

System.Reflection.Emit Namespace