private int FindIndexer(Type type, Expression[] args, out MethodBase method)
{
foreach (Type t in SelfAndBaseTypes(type))
{
MemberInfo[] members = t.GetDefaultMembers();
if (members.Length != 0)
{
IEnumerable<MethodBase> methods = members.
OfType<PropertyInfo>().
Select(p => (MethodBase) p.GetGetMethod()).
Where(m => m != null);
int count = FindBestMethod(methods, Maybe.Nothing, args, out method);
if (count != 0) return count;
}
}
method = null;
return 0;
}