mscorlib(4.0.0.0) API with additions
NewArrayExpression.cs
3 using System.Diagnostics;
4 
6 {
8  [DebuggerTypeProxy(typeof(NewArrayExpressionProxy))]
9  [global::__DynamicallyInvokable]
11  {
12  private readonly ReadOnlyCollection<Expression> _expressions;
13 
14  private readonly Type _type;
15 
18  [global::__DynamicallyInvokable]
19  public sealed override Type Type
20  {
21  [global::__DynamicallyInvokable]
22  get
23  {
24  return _type;
25  }
26  }
27 
30  [global::__DynamicallyInvokable]
32  {
33  [global::__DynamicallyInvokable]
34  get
35  {
36  return _expressions;
37  }
38  }
39 
40  internal NewArrayExpression(Type type, ReadOnlyCollection<Expression> expressions)
41  {
42  _expressions = expressions;
43  _type = type;
44  }
45 
46  internal static NewArrayExpression Make(ExpressionType nodeType, Type type, ReadOnlyCollection<Expression> expressions)
47  {
48  if (nodeType == ExpressionType.NewArrayInit)
49  {
50  return new NewArrayInitExpression(type, expressions);
51  }
52  return new NewArrayBoundsExpression(type, expressions);
53  }
54 
58  [global::__DynamicallyInvokable]
59  protected internal override Expression Accept(ExpressionVisitor visitor)
60  {
61  return visitor.VisitNewArray(this);
62  }
63 
67  [global::__DynamicallyInvokable]
69  {
70  if (expressions == Expressions)
71  {
72  return this;
73  }
74  if (NodeType == ExpressionType.NewArrayInit)
75  {
76  return Expression.NewArrayInit(Type.GetElementType(), expressions);
77  }
78  return Expression.NewArrayBounds(Type.GetElementType(), expressions);
79  }
80  }
81 }
abstract Type GetElementType()
When overridden in a derived class, returns the T:System.Type of the object encompassed or referred t...
Provides the base class for a generic read-only collection.
Represents creating a new array and possibly initializing the elements of the new array.
Definition: __Canon.cs:3
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
Provides the base class from which the classes that represent expression tree nodes are derived....
Definition: Expression.cs:17
NewArrayExpression Update(IEnumerable< Expression > expressions)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
internal override Expression Accept(ExpressionVisitor visitor)
Dispatches to the specific visit method for this node type. For example, T:System....
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
ExpressionType
Describes the node types for the nodes of an expression tree.
ReadOnlyCollection< Expression > Expressions
Gets the bounds of the array if the value of the P:System.Linq.Expressions.Expression....
virtual internal Expression VisitNewArray(NewArrayExpression node)
Visits the children of the T:System.Linq.Expressions.NewArrayExpression.
Represents a visitor or rewriter for expression trees.