Unverified Commit cdab1126 authored by Vinicius Jarina's avatar Vinicius Jarina Committed by GitHub
Browse files

Merge pull request #245 from Avetome/master

Finding extention methods by interface too
parents 4d6aefe1 0d96ff03
......@@ -160,7 +160,9 @@ namespace NLua.Extensions
where extensionType.IsSealed() && !extensionType.IsGenericType() && !extensionType.IsNested
from method in extensionType.GetMethods (BindingFlags.Static | BindingFlags.Public)
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;
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