public string Run(Scripts.ICommunicator communicator) { try { objectFromAssembly = host.GetImplementation <Scripts.IScript>(); if (objectFromAssembly != null) { handle = objectFromAssembly.Instance as Scripts.Base; if (handle == null) { return("Unable to create script object"); } } else { return("Unable to find Script interface"); } if (!host.InjectCommunicator(communicator)) { return("Unable to inject Communicator Object"); } return(OnCreate()); } catch (Exception e) { return(e.Message); } }
private bool InjectCommunicator(Scripts.ICommunicator communicator) { /*Type t = assembly.GetType("Scripts.Main"); * if (t != null) * { * Type b = t.BaseType; * MethodInfo info = b.GetMethod("InjectCommunicator"); * info.Invoke(null, new object[] { communicator }); * return true; * }*/ return(false); }
private bool InjectCommunicator(Scripts.ICommunicator communicator) { Type t = assembly.GetType("Scripts.Main"); if (t != null) { Type b = t.BaseType; MethodInfo info = b.GetMethod("InjectCommunicator"); info.Invoke(null, new object[] { communicator }); return(true); } return(false); }
public bool InjectCommunicator(Scripts.ICommunicator communicator) { foreach (var asm in Assemblies) { Type t = asm.GetType("Scripts.Main"); if (t != null) { Type b = t.BaseType; MethodInfo info = b.GetMethod("InjectCommunicator"); info.Invoke(null, new object[] { communicator }); return(true); } } return(false); }
public string Run(Scripts.ICommunicator communicator) { try { Type type = assembly.GetType("Scripts.Main"); var obj = Activator.CreateInstance(type); handle = (obj as Scripts.Base); if (!InjectCommunicator(communicator)) { return("Unable to inject Communicator Object"); } return(OnCreate()); } catch (Exception e) { return(e.Message); } }
public bool InjectCommunicator(Scripts.ICommunicator communicator) { return(Loader.InjectCommunicator(communicator)); }