private EmitCall ( System opcode, System methodInfo, System optionalParameterTypes ) : void | ||
opcode | System | |
methodInfo | System | |
optionalParameterTypes | System | |
return | void |
MethodInfo consoleWriteMethod = typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }); ilGenerator.EmitCall(consoleWriteMethod, new Type[] { typeof(string) });
MethodInfo addMethod = typeof(Math).GetMethod("Add", new Type[] { typeof(int), typeof(int) }); ilGenerator.EmitCall(addMethod, new Type[] { typeof(int), typeof(int) });This example shows how `EmitCall` can be used to call a static method from the `Math` class, passing in two integer arguments and adding them together. Package/Library: System.Reflection.Emit.
private EmitCall ( System opcode, System methodInfo, System optionalParameterTypes ) : void | ||
opcode | System | |
methodInfo | System | |
optionalParameterTypes | System | |
return | void |