So I got most of it working - Here's what i'm doing now. I just need some direction/assistance on one line, which is the MethodInfo object.Invoke method.
public void RunScript(string scriptName)
{
Assembly _assemblyInfo = Assembly.LoadFrom(scriptName);
Type[] types = _assemblyInfo.GetTypes();
Type temp = null;
foreach (Type t in types)
{
if (t.FullName == "Scripting.Test.Autosniff")
{
Console.Write("this may actually work\n");
temp = t;
break;
}
}
MethodInfo meth;
meth = temp.GetMethod("RunScript");
meth.Invoke(???, null);
}
I've tried passing temp into the first parameter of Invoke, but it fails saying it's of a different type than needed.
BTW, the RunScrpt Method is:
public override void RunScript()
{
x = 5;
y = 10;
z = 15;
}
Just some placeholder stuff to get the method invoke working.
Thanks,