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.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Overridable Sub EmitCalli ( _ opcode As OpCode, _ callingConvention As CallingConventions, _ returnType As Type, _ parameterTypes As Type(), _ optionalParameterTypes As Type() _ )
Parameters
- opcode
- Type: System.Reflection.Emit.OpCode
The MSIL instruction to be emitted onto the stream. Must be OpCodes.Calli.
- callingConvention
- Type: System.Reflection.CallingConventions
The managed calling convention to be used.
- returnType
- Type: System.Type
The Type of the result.
- parameterTypes
- Type:
System.Type
()
The types of the required arguments to the instruction.
- optionalParameterTypes
- Type:
System.Type
()
The types of the optional arguments for varargs calls.
| Exception | Condition |
|---|---|
| InvalidOperationException | optionalParameterTypes is not Nothing, but callingConvention does not include the CallingConventions.VarArgs flag. |
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.