[IronPython] Creating/using delegate types in IronPython

Brian Quinlan brian at sweetapp.com
Sat May 27 15:06:16 CEST 2006


1. Is it possible to use existing delegates (as the caller) in
    IronPython e.g. is there some way to make this work:

 >>> from System import EventHandler, EventArgs
 >>> my_event = EventHandler()
Traceback (most recent call last):
   File , line 0, in input##5
 >>> # my_event += lambda x,y : None
 >>> # my_event(None, EventArgs())

Or some equivalent syntax for accomplishing the same thing?

2. Is it possible to define new delegate types in IronPython e.g. like 
this C# would:

public delegate Foo(int bar, string baz);

Cheers,
Brian






More information about the Ironpython-users mailing list