Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
ead94f06
Commit
ead94f06
authored
Feb 12, 2013
by
Vinicius Jarina
Browse files
Fixed EventException test. (iOS)
parent
0403b1fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/LuaTests.cs
View file @
ead94f06
...
@@ -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!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment