I'm trying to get current submission instance in csharp csx script. I need to invoke script method with reflection:
using System.Reflection;
void Foo()
{
}
var foo = MethodBase.GetCurrentMethod().DeclaringType.GetMethod("Foo");
foo.Invoke(???, null);
I cannot use this
keyword, as it's not available in scripting context:
error CS0027: Keyword `this` is not available in the current context
Trying to invoke foo.Invoke(null, null)
fails because Foo
is not a static method.
Does anyone know if this is possible?