private void MakeMethodBody(Action <ILGenerator> action, string ilKey) { int ThreadId = Thread.CurrentThread.ManagedThreadId; string dynamicMethodName = methodName + EHandler.Index; newMethod = new DynamicMethod(dynamicMethodName, ReturnType, ParameterTypes); il = newMethod.GetILGenerator(); if (ilKey != null) { key = ilKey; DebugHelper.Start(key); ThreadCache.TKeyDict[ThreadId] = key; ThreadCache.TILDict[ThreadId] = il; } else { DebugHelper.Start(dynamicMethodName); ThreadCache.ILDict[ThreadId] = il; } if (action != null) { action(il); } }