/// <summary>
 /// Visits an index expression slim tree node, produces an index expression.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <param name="object">Object expression.</param>
 /// <param name="arguments">Argument expressions.</param>
 /// <returns>The index expression represented by the expression slim node.</returns>
 protected override Expression MakeIndex(IndexExpressionSlim node, Expression @object, ReadOnlyCollection <Expression> arguments)
 {
     if (node.Indexer != null)
     {
         var indexer = MakeProperty(node.Indexer);
         return(_factory.MakeIndex(@object, indexer, arguments));
     }
     else
     {
         return(_factory.MakeIndex(@object, indexer: null, arguments));
     }
 }
示例#2
0
        protected internal override ExpressionSlim VisitIndex(IndexExpressionSlim node)
        {
            Append("Index(");
            if (node.Indexer != null)
            {
                Append(node.Indexer);
                Append(", ");
            }
            Visit(node.Object);
            Append(", ");
            Visit(", ", node);
            Append(')');

            return(node);
        }
 /// <summary>
 /// Visits an index expression node.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <returns>Result of visiting the node.</returns>
 protected internal virtual ExpressionSlim VisitIndex(IndexExpressionSlim node)
 {
     return(node.Update(Visit(node.Object), Visit(node.Arguments)));
 }