private static void WriteClosureBodies(List <MethodInterpreter> closure, StringBuilder sb, TypeDescriptionTable typeTable, CrRuntimeLibrary crRuntime) { sb.AppendLine("///--- PInvoke code --- "); foreach (var interpreter in closure) { if (interpreter.Kind != MethodKind.PlatformInvoke) { continue; } sb.AppendLine(MethodInterpreterCodeWriter.WritePInvokeMethodCode(interpreter)); } sb.AppendLine("///---Begin closure code --- "); foreach (var interpreter in closure) { if (interpreter.Kind != MethodKind.Default) { continue; } if (interpreter.Method.IsAbstract) { continue; } sb.AppendLine(MethodInterpreterCodeWriter.WriteMethodCode(interpreter, typeTable, crRuntime)); } sb.AppendLine("///---End closure code --- "); }
private static void WriteClosureBodies(List <MethodInterpreter> closure, StringBuilder sb, TypeDescriptionTable typeTable, ClosureEntities closureEntities) { sb.AppendLine("///--- PInvoke code --- "); foreach (var interpreter in closure) { if (interpreter.Kind != MethodKind.PlatformInvoke) { continue; } sb.AppendLine(MethodInterpreterCodeWriter.WritePInvokeMethodCode((PlatformInvokeMethod)interpreter, closureEntities)); } sb.AppendLine("///---Begin closure code --- "); foreach (var interpreter in closure) { if (interpreter.Kind != MethodKind.CilInstructions) { continue; } if (interpreter.Method.IsAbstract) { continue; } sb.AppendLine(MethodInterpreterCodeWriter.WriteMethodCode((CilMethodInterpreter)interpreter, typeTable, closureEntities)); } sb.AppendLine("///---End closure code --- "); }