Exemplo n.º 1
0
        protected internal override ExpressionSlim VisitListInit(ListInitExpressionSlim node)
        {
            Append("ListInit(");
            Visit(node.NewExpression);
            Append(", ");
            Visit(", ", node.Initializers, VisitElementInit);
            Append(')');

            return(node);
        }
 /// <summary>
 /// Visits a list init expression slim tree node, produces a list init expression.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <param name="newExpression">New expression.</param>
 /// <param name="initializers">Initializer expressions.</param>
 /// <returns>The list init expression represented by the expression slim node.</returns>
 protected override Expression MakeListInit(ListInitExpressionSlim node, NewExpression newExpression, ReadOnlyCollection <ElementInit> initializers)
 {
     return(_factory.ListInit(newExpression, initializers));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Visits a list initializer expression tree node.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <returns>Result of visiting the node.</returns>
 protected internal virtual ExpressionSlim VisitListInit(ListInitExpressionSlim node)
 {
     return(node.Update(VisitAndConvert(node.NewExpression), Visit(node.Initializers, VisitElementInit)));
 }