Commit 0d96ff03 authored by avetome's avatar avetome
Browse files

Finding extention methods by interface too

parent 4d6aefe1
...@@ -160,7 +160,9 @@ namespace NLua.Extensions ...@@ -160,7 +160,9 @@ namespace NLua.Extensions
where extensionType.IsSealed() && !extensionType.IsGenericType() && !extensionType.IsNested where extensionType.IsSealed() && !extensionType.IsGenericType() && !extensionType.IsNested
from method in extensionType.GetMethods (BindingFlags.Static | BindingFlags.Public) from method in extensionType.GetMethods (BindingFlags.Static | BindingFlags.Public)
where method.IsDefined (typeof (ExtensionAttribute), false) where method.IsDefined (typeof (ExtensionAttribute), false)
where (method.GetParameters () [0].ParameterType == type || type.IsSubclassOf(method.GetParameters()[0].ParameterType)) where (method.GetParameters()[0].ParameterType == type
|| type.IsSubclassOf(method.GetParameters()[0].ParameterType)
|| type.GetInterfaces().Contains(method.GetParameters()[0].ParameterType))
select method; select method;
return query.ToArray<MethodInfo> (); return query.ToArray<MethodInfo> ();
} }
......
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