private void Execute(MethodInfo method, params object[] parameters) { var typeToLoad = method.DeclaringType; var instance = reflectionWrapper.InvokeMethod(instanceManagerType, _classInstanceManager, "Get", typeToLoad); var logger = LogManager.GetLogger("Sandbox"); if (instance == null) { var error = "Could not load instance type: " + typeToLoad; logger.Error(error); throw new Exception(error); } reflectionWrapper.Invoke(method, instance, parameters); }
protected void Execute(MethodInfo method, params object[] parameters) { var typeToLoad = method.DeclaringType; var instance = _reflectionWrapper.InvokeMethod(_classInstanceManagerType, _classInstanceManager, "Get", typeToLoad); if (instance == null) { var error = "Could not load instance type: " + typeToLoad; Logger.Error(error); throw new Exception(error); } _reflectionWrapper.Invoke(method, instance, parameters); }