How to use code generation to dynamically create C# methods?

后端 未结 4 1058
忘了有多久
忘了有多久 2021-02-05 17:11

In order to define a method in C that is callable by Lua it has to match a given signature and use the Lua API to retrieve parameters and return results. I\'m writing a C# wrapp

4条回答
  •  死守一世寂寞
    2021-02-05 17:48

    You could expose your C# as COM, which would allow all the (public) methods to be called be external apps.

    Or, expose a single C# function which would call the appropriate other function, perhaps hard-coded for the list of actual functions in C#, or perhaps using reflection. It might take an arbitrary sized array for the parameters.

提交回复
热议问题