Commit ead94f06 authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Fixed EventException test. (iOS)

parent 0403b1fd
...@@ -292,6 +292,17 @@ namespace LuaInterfaceTest ...@@ -292,6 +292,17 @@ namespace LuaInterfaceTest
return val * val2; return val * val2;
} }
class LuaEventArgsHandler : LuaInterface.Method.LuaDelegate
{
void CallFunction (object sender, EventArgs eventArgs)
{
object [] args = new object [] {sender, eventArgs };
object [] inArgs = new object [] { sender, eventArgs };
int [] outArgs = new int [] { };
base.callFunction (args, inArgs, outArgs);
}
}
[Test] [Test]
public void TestEventException () public void TestEventException ()
...@@ -300,6 +311,7 @@ namespace LuaInterfaceTest ...@@ -300,6 +311,7 @@ namespace LuaInterfaceTest
//Register a C# function //Register a C# function
MethodInfo testException = this.GetType ().GetMethod ("_TestException", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, null, new Type [] { typeof (float), typeof (float) }, null); MethodInfo testException = this.GetType ().GetMethod ("_TestException", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, null, new Type [] { typeof (float), typeof (float) }, null);
lua.RegisterFunction ("Multiply", this, testException); lua.RegisterFunction ("Multiply", this, testException);
lua.RegisterLuaDelegateType (typeof (EventHandler<EventArgs>), typeof (LuaEventArgsHandler));
//create the lua event handler code for the entity //create the lua event handler code for the entity
//includes the bad code! //includes the bad code!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment