Пример #1
0
        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);
        }
Пример #2
0
 private static IEnumerable <Expression> GetIndexerArguments(IndexerToken indexerToken)
 {
     return(indexerToken.Arguments.Select(a => (Expression)Expression.Constant(a)));
 }