# Need a marco auto convert Haxe's Function to cs Action?

**URL:** https://community.haxe.org/t/need-a-marco-auto-convert-haxes-function-to-cs-action/2108
**Category:** Haxe
**Tags:** macro, haxe-cs
**Created:** [October 29, 2019, 10:29am UTC](https://community.haxe.org/t/need-a-marco-auto-convert-haxes-function-to-cs-action/2108 "2019-10-29T10:29:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [October 29, 2019, 10:29am UTC](https://community.haxe.org/t/need-a-marco-auto-convert-haxes-function-to-cs-action/2108/1 "2019-10-29T10:29:38Z")

</div>

need a marco auto-convert Haxe’s Function to cs Action?

current I have a project mixed use c# and haxe .

the problem what I got is can’t direct use haxe Function in c# target .

like

addEventListener(event, handler);

handle in Haxe ,it’s a function ,but in cs ,it’s an Action or delegate, I can’t pass a delegate to haxe use

our original code compiler from haxe.

it’s huge work to change all

addEventListener(event, handler); hander to Action.

is there any easy to do this?

---

<div class="post-metadata">

### Author: ![kevinresol](https://community.haxe.org/user_avatar/community.haxe.org/kevinresol/32/272_2.png) [@kevinresol](https://community.haxe.org/u/kevinresol)
#### Post date: [April 21, 2020, 8:34am UTC](https://community.haxe.org/t/need-a-marco-auto-convert-haxes-function-to-cs-action/2108/2 "2020-04-21T08:34:03Z")

</div>

Here are some examples: [napi/Function.hx at code · kevinresol/napi · GitHub](https://github.com/kevinresol/napi/blob/code/src/napi/types/Function.hx)
