[Mono-list] late linking & dynamic invocation ...
Miguel de Icaza
miguel@ximian.com
05 Jul 2002 17:33:08 -0400
> > win.DeleteEvent += new EventHandler (Window_Delete);
> >
> > Notice that the delegate signature is `EventHandler', not
> > DelegateObjectEventArgs ;-)
>
> Yes - but the 'EventHandler' signature blows - that's the whole point;
> the EventHandler forces you to do your own de-marshaling, in a horribly
> type un-friendly fashion; thus for eg. the above SizeAllocation you get
> to do:
Michael, the example you show is a limitation on the Gtk# code
generation, and has nothing to do with a limitation with the delegates.
This is indeed ugly:
>
> void mySizeAllocateMethod (Object [] args)
> {
> long demarshal_i = args [0];
> int demarshal_j = args [1];
> string demarshal_name = args [2];
>
> ... now we do the method ...
> }
While the real signature should just be:
void mySizeAllocateMethod (long i, long j, string name)
{
}
But this is not a C#/.NET limitation, it is a binding-generation
limitation.
Miguel.