Example #1
0
        public static IEnumerable <CodeInstruction> TestTryFinallyTranspiler(IEnumerable <CodeInstruction> instructionEnumerable, MethodBase method, ILGenerator ilGenerator)
        {
            var context      = new TranspilerContext <CodeInstruction>(ilGenerator, method, instructionEnumerable);
            var instructions = context.Instructions;

            instructions.ToDebugString().Log("before");
            context.AddTryFinally(HarmonyTranspilerDebugExtensions.StringLogInstructions("hello world"));
            instructions.ToDebugString().Log("after");
            return(instructions);
        }