internal static MethodManager ReflectMethod(this VariableManager basic, String MethodName, Type type) { MethodInfo method = type.GetMethod(MethodName, Type.EmptyTypes); basic.Output(); basic.Emit(OpCodes.Callvirt, method); if (method.ReturnType != null && method.ReturnType != typeof(void)) { CacheManager.retValue = true; } return(new MethodManager(basic, method.ReturnType)); }
internal static MethodManager ReflectMethod <T>(this VariableManager basic, String MethodName, params LocalBuilder[] parameters) { Type type = typeof(T); MethodInfo method = type.GetMethod(MethodName, parameters.Select(x => x.LocalType).ToArray()); basic.Output(); parameters.ToList().ForEach(x => basic.Emit(OpCodes.Ldloc_S, x)); basic.Emit(OpCodes.Callvirt, method); if (method.ReturnType != null && method.ReturnType != typeof(void)) { CacheManager.retValue = true; } return(new MethodManager(basic, method.ReturnType)); }