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
6d7f530a
Commit
6d7f530a
authored
Oct 10, 2014
by
Vinicius Jarina
Browse files
Fixed more #if typos.
parent
8ec434bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Core/NLua/Extensions/GeneralExtensions.cs
View file @
6d7f530a
...
...
@@ -248,11 +248,7 @@ namespace NLua.Extensions
#else
return
t
.
IsInterface
;
#endif
}
}
public
static
Assembly
GetAssembly
(
this
Type
t
)
{
...
...
@@ -263,58 +259,36 @@ namespace NLua.Extensions
#endif
}
#if NETFX_CORE
public
static
IEnumerable
<
MethodInfo
>
GetStaticPublicMethods
(
this
Type
t
,
string
name
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
,
name
).
Where
(
m
=>
m
.
IsStatic
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Static
);
#endif
}
public
static
IEnumerable
<
MethodInfo
>
GetStaticPublicMethods
(
this
Type
t
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
).
Where
(
m
=>
m
.
IsStatic
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Static
);
#endif
}
public
static
IEnumerable
<
MethodInfo
>
GetInstancePublicMethods
(
this
Type
t
,
string
name
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
,
name
).
Where
(
m
=>
!
m
.
IsStatic
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Instance
);
#endif
}
public
static
IEnumerable
<
MethodInfo
>
GetInstancePublicMethods
(
this
Type
t
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
).
Where
(
m
=>
!
m
.
IsStatic
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Instance
);
#endif
}
public
static
IEnumerable
<
MethodInfo
>
GetPublicMethods
(
this
Type
t
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Instance
|
BindingFlags
.
Static
);
#endif
}
public
static
IEnumerable
<
MethodInfo
>
GetPublicMethods
(
this
Type
t
,
string
name
)
{
#if NETFX_CORE
return
GetAllDeclaredMethodsRecursively
(
t
,
name
);
#else
return
t
.
GetMethods
(
BindingFlags
.
Public
|
BindingFlags
.
Instance
|
BindingFlags
.
Static
).
Where
(
m
=>
m
.
Name
==
name
);
#endif
}
public
static
MethodInfo
GetPublicMethod
(
this
Type
t
,
string
name
)
...
...
@@ -337,13 +311,8 @@ namespace NLua.Extensions
public
static
MethodInfo
GetPublicMethod
(
this
Type
t
,
string
name
,
Type
[]
signature
)
{
#if NETFX_CORE
var
methods
=
t
.
GetPublicMethods
(
name
);
return
methods
.
Where
(
m
=>
Match
(
m
.
GetParameters
(),
signature
)).
FirstOrDefault
();
#else
return
t
.
GetMethod
(
name
,
BindingFlags
.
Public
|
BindingFlags
.
Static
|
BindingFlags
.
Instance
,
null
,
signature
,
null
);
#endif
}
static
IEnumerable
<
MethodInfo
>
GetAllDeclaredMethodsRecursively
(
Type
t
,
string
name
)
...
...
@@ -392,27 +361,18 @@ namespace NLua.Extensions
return
fields
.
Concat
(
GetAllDeclaredFieldsRecursively
(
baseType
));
}
public
static
IEnumerable
<
FieldInfo
>
GetPublicFields
(
this
Type
t
)
{
#if NETFX_CORE
return
GetAllDeclaredFieldsRecursively
(
t
);
#else
return
t
.
GetFields
();
#endif
}
public
static
FieldInfo
GetPublicField
(
this
Type
t
,
string
name
)
{
#if NETFX_CORE
return
GetDeclaredFieldRecursively
(
t
,
name
);
#else
return
t
.
GetField
(
name
);
#endif
}
#if NETFX_CORE
static
IEnumerable
<
Type
>
GetTypes
(
this
Assembly
assembly
)
{
return
assembly
.
ExportedTypes
;
...
...
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