I'm not a C# expert by any means, I know just enough to be dangerous.
Under b3 I had this code that worked:

public void AddEventHandler(string e, EventHandler handler)
{
      Python.Ops.GetMember<System.Action<string,
EventHandler>>(Helper, "AddEventHandler")(e, handler);
}

Helper is an IronPython class instance that I'm wrapping in a C#
class. I'm calling the python objects AddEventHandler method.

Unfortunately the delegate regressions seem to be causing this code to
fail (traceback below) how can I fix this code so that it will work
with b5 sources? I'm at something of a loss.

Thanks,
-Dan

System.ArgumentNullException: Value cannot be null.
Parameter name: context
   at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object
value, String paramName)
   at Microsoft.Scripting.Runtime.BinderOps.GetDelegate(CodeContext
context, Object callableObject, Type delegateType)
   at _stub_$3358##2130(Closure , CallSite , Object )
   at System.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3
target, CallSite site, Object[] args)
   at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)
   at System.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite
site, T0 arg0)
   at _stub_$3357##2129(Closure , CallSite , CodeContext , Object )
   at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4
target, CallSite site, Object[] args)
   at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)
   at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite
site, T0 arg0, T1 arg1)
   at Microsoft.Scripting.Runtime.DynamicOperations.GetMember[T](Object
obj, String name)
   at Microsoft.Scripting.Hosting.ObjectOperations.GetMember[T](Object
obj, String name)
   at BeskarNET.Python.GetMember[T](Object obj, String name)
   at BeskarNET.EventGroup.EventHelper.AddEventHandler(String e,
EventHandler handler)
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to