System.Linq.Dynamic.ExpressionParser.FindIndexer C# (CSharp) Method

FindIndexer() private method

private FindIndexer ( Type type, Expression args, MethodBase &method ) : int
type System.Type
args System.Linq.Expressions.Expression
method System.Reflection.MethodBase
return int
		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;
		}
ExpressionParser