private static MemberInfo GetMemberInfoFromIndexerToken(IndexerToken token, Type targetType) { PropertyInfo indexerPropertyInfo = TypeExtensions.GetIndexerPropertyInfo(targetType, token.Arguments.Select(a => a.GetType()).ToArray()); if (indexerPropertyInfo != null) { return(indexerPropertyInfo.GetGetMethod()); } return(null); }
private static IEnumerable <Expression> GetIndexerArguments(IndexerToken indexerToken) { return(indexerToken.Arguments.Select(a => (Expression)Expression.Constant(a))); }