public override HeronValue Apply(VM vm, HeronValue[] args) { Object[] os = HeronDotNet.ObjectsToDotNetArray(args); Object o = self.GetSystemType().InvokeMember(name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, self.Unmarshal(), os); return(DotNetObject.Marshal(o)); }
public override HeronValue Invoke(VM vm, HeronValue self, HeronValue[] args) { Trace.Assert(self == null); Object[] os = HeronDotNet.ObjectsToDotNetArray(args); Object o = this.self.GetSystemType().InvokeMember(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, os); return(DotNetObject.Marshal(o)); }
public override HeronValue Instantiate(VM vm, HeronValue[] args, ModuleInstance m) { Object[] objs = HeronDotNet.ObjectsToDotNetArray(args); Object o = GetSystemType().InvokeMember(null, BindingFlags.Instance | BindingFlags.Public | BindingFlags.Default | BindingFlags.CreateInstance, null, null, objs); if (o == null) { throw new Exception("Unable to construct " + name); } return(DotNetObject.Marshal(o)); }