I’m trying to figure out how to generate C# delegates
from Haxe, and so far I have tried the following code:
@:delegate
public function myDelegate():Void; //Generates -> public virtual void myDelegate();
@:delegate
public var myDelegate:Function; //Generates -> public object myDelegate;
@:delegate
public var myDelegate:Object -> EventArgs -> Void; //Generates -> public global::haxe.lang.Function myDelegate;
None of which are the results I expect. I have a two part question:
Does the @:delegate
metadata actually do anything?
And how best do you go about creating an actual delegate definition, like the following:
public delegate void myDelegate(object sender, EventArgs e);
Or is the above just not possible?