mscorlib(4.0.0.0) API with additions
ExpressionVisitor.cs
2 using System.Dynamic.Utils;
4 
6 {
8  [global::__DynamicallyInvokable]
9  public abstract class ExpressionVisitor
10  {
12  [global::__DynamicallyInvokable]
13  protected ExpressionVisitor()
14  {
15  }
16 
20  [global::__DynamicallyInvokable]
21  public virtual Expression Visit(Expression node)
22  {
23  return node?.Accept(this);
24  }
25 
29  [global::__DynamicallyInvokable]
31  {
32  Expression[] array = null;
33  int i = 0;
34  for (int count = nodes.Count; i < count; i++)
35  {
36  Expression expression = Visit(nodes[i]);
37  if (array != null)
38  {
39  array[i] = expression;
40  }
41  else if (expression != nodes[i])
42  {
43  array = new Expression[count];
44  for (int j = 0; j < i; j++)
45  {
46  array[j] = nodes[j];
47  }
48  array[i] = expression;
49  }
50  }
51  if (array == null)
52  {
53  return nodes;
54  }
55  return new TrueReadOnlyCollection<Expression>(array);
56  }
57 
58  internal Expression[] VisitArguments(IArgumentProvider nodes)
59  {
60  Expression[] array = null;
61  int i = 0;
62  for (int argumentCount = nodes.ArgumentCount; i < argumentCount; i++)
63  {
64  Expression argument = nodes.GetArgument(i);
65  Expression expression = Visit(argument);
66  if (array != null)
67  {
68  array[i] = expression;
69  }
70  else if (expression != argument)
71  {
72  array = new Expression[argumentCount];
73  for (int j = 0; j < i; j++)
74  {
75  array[j] = nodes.GetArgument(j);
76  }
77  array[i] = expression;
78  }
79  }
80  return array;
81  }
82 
88  [global::__DynamicallyInvokable]
89  public static ReadOnlyCollection<T> Visit<T>(ReadOnlyCollection<T> nodes, Func<T, T> elementVisitor)
90  {
91  T[] array = null;
92  int i = 0;
93  for (int count = nodes.Count; i < count; i++)
94  {
95  T val = elementVisitor(nodes[i]);
96  if (array != null)
97  {
98  array[i] = val;
99  }
100  else if ((object)val != (object)nodes[i])
101  {
102  array = new T[count];
103  for (int j = 0; j < i; j++)
104  {
105  array[j] = nodes[j];
106  }
107  array[i] = val;
108  }
109  }
110  if (array == null)
111  {
112  return nodes;
113  }
114  return new TrueReadOnlyCollection<T>(array);
115  }
116 
123  [global::__DynamicallyInvokable]
124  public T VisitAndConvert<T>(T node, string callerName) where T : Expression
125  {
126  if (node == null)
127  {
128  return null;
129  }
130  node = (Visit(node) as T);
131  if (node == null)
132  {
133  throw Error.MustRewriteToSameNode(callerName, typeof(T), callerName);
134  }
135  return node;
136  }
137 
144  [global::__DynamicallyInvokable]
146  {
147  T[] array = null;
148  int i = 0;
149  for (int count = nodes.Count; i < count; i++)
150  {
151  T val = Visit(nodes[i]) as T;
152  if (val == null)
153  {
154  throw Error.MustRewriteToSameNode(callerName, typeof(T), callerName);
155  }
156  if (array != null)
157  {
158  array[i] = val;
159  }
160  else if (val != nodes[i])
161  {
162  array = new T[count];
163  for (int j = 0; j < i; j++)
164  {
165  array[j] = nodes[j];
166  }
167  array[i] = val;
168  }
169  }
170  if (array == null)
171  {
172  return nodes;
173  }
174  return new TrueReadOnlyCollection<T>(array);
175  }
176 
180  [global::__DynamicallyInvokable]
181  protected internal virtual Expression VisitBinary(BinaryExpression node)
182  {
183  return ValidateBinary(node, node.Update(Visit(node.Left), VisitAndConvert(node.Conversion, "VisitBinary"), Visit(node.Right)));
184  }
185 
189  [global::__DynamicallyInvokable]
190  protected internal virtual Expression VisitBlock(BlockExpression node)
191  {
192  int expressionCount = node.ExpressionCount;
193  Expression[] array = null;
194  for (int i = 0; i < expressionCount; i++)
195  {
196  Expression expression = node.GetExpression(i);
197  Expression expression2 = Visit(expression);
198  if (expression != expression2)
199  {
200  if (array == null)
201  {
202  array = new Expression[expressionCount];
203  }
204  array[i] = expression2;
205  }
206  }
207  ReadOnlyCollection<ParameterExpression> readOnlyCollection = VisitAndConvert(node.Variables, "VisitBlock");
208  if (readOnlyCollection == node.Variables && array == null)
209  {
210  return node;
211  }
212  for (int j = 0; j < expressionCount; j++)
213  {
214  if (array[j] == null)
215  {
216  array[j] = node.GetExpression(j);
217  }
218  }
219  return node.Rewrite(readOnlyCollection, array);
220  }
221 
225  [global::__DynamicallyInvokable]
226  protected internal virtual Expression VisitConditional(ConditionalExpression node)
227  {
228  return node.Update(Visit(node.Test), Visit(node.IfTrue), Visit(node.IfFalse));
229  }
230 
234  [global::__DynamicallyInvokable]
235  protected internal virtual Expression VisitConstant(ConstantExpression node)
236  {
237  return node;
238  }
239 
243  [global::__DynamicallyInvokable]
244  protected internal virtual Expression VisitDebugInfo(DebugInfoExpression node)
245  {
246  return node;
247  }
248 
252  [global::__DynamicallyInvokable]
253  protected internal virtual Expression VisitDynamic(DynamicExpression node)
254  {
255  Expression[] array = VisitArguments(node);
256  if (array == null)
257  {
258  return node;
259  }
260  return node.Rewrite(array);
261  }
262 
266  [global::__DynamicallyInvokable]
267  protected internal virtual Expression VisitDefault(DefaultExpression node)
268  {
269  return node;
270  }
271 
275  [global::__DynamicallyInvokable]
276  protected internal virtual Expression VisitExtension(Expression node)
277  {
278  return node.VisitChildren(this);
279  }
280 
284  [global::__DynamicallyInvokable]
285  protected internal virtual Expression VisitGoto(GotoExpression node)
286  {
287  return node.Update(VisitLabelTarget(node.Target), Visit(node.Value));
288  }
289 
293  [global::__DynamicallyInvokable]
294  protected internal virtual Expression VisitInvocation(InvocationExpression node)
295  {
296  Expression expression = Visit(node.Expression);
297  Expression[] array = VisitArguments(node);
298  if (expression == node.Expression && array == null)
299  {
300  return node;
301  }
302  return node.Rewrite(expression, array);
303  }
304 
308  [global::__DynamicallyInvokable]
309  protected virtual LabelTarget VisitLabelTarget(LabelTarget node)
310  {
311  return node;
312  }
313 
317  [global::__DynamicallyInvokable]
318  protected internal virtual Expression VisitLabel(LabelExpression node)
319  {
320  return node.Update(VisitLabelTarget(node.Target), Visit(node.DefaultValue));
321  }
322 
327  [global::__DynamicallyInvokable]
328  protected internal virtual Expression VisitLambda<T>(Expression<T> node)
329  {
330  return node.Update(Visit(node.Body), VisitAndConvert(node.Parameters, "VisitLambda"));
331  }
332 
336  [global::__DynamicallyInvokable]
337  protected internal virtual Expression VisitLoop(LoopExpression node)
338  {
339  return node.Update(VisitLabelTarget(node.BreakLabel), VisitLabelTarget(node.ContinueLabel), Visit(node.Body));
340  }
341 
345  [global::__DynamicallyInvokable]
346  protected internal virtual Expression VisitMember(MemberExpression node)
347  {
348  return node.Update(Visit(node.Expression));
349  }
350 
354  [global::__DynamicallyInvokable]
355  protected internal virtual Expression VisitIndex(IndexExpression node)
356  {
357  Expression expression = Visit(node.Object);
358  Expression[] array = VisitArguments(node);
359  if (expression == node.Object && array == null)
360  {
361  return node;
362  }
363  return node.Rewrite(expression, array);
364  }
365 
369  [global::__DynamicallyInvokable]
370  protected internal virtual Expression VisitMethodCall(MethodCallExpression node)
371  {
372  Expression expression = Visit(node.Object);
373  Expression[] array = VisitArguments(node);
374  if (expression == node.Object && array == null)
375  {
376  return node;
377  }
378  return node.Rewrite(expression, array);
379  }
380 
384  [global::__DynamicallyInvokable]
385  protected internal virtual Expression VisitNewArray(NewArrayExpression node)
386  {
387  return node.Update(Visit(node.Expressions));
388  }
389 
393  [global::__DynamicallyInvokable]
394  protected internal virtual Expression VisitNew(NewExpression node)
395  {
396  return node.Update(Visit(node.Arguments));
397  }
398 
402  [global::__DynamicallyInvokable]
403  protected internal virtual Expression VisitParameter(ParameterExpression node)
404  {
405  return node;
406  }
407 
411  [global::__DynamicallyInvokable]
413  {
414  return node.Update(VisitAndConvert(node.Variables, "VisitRuntimeVariables"));
415  }
416 
420  [global::__DynamicallyInvokable]
421  protected virtual SwitchCase VisitSwitchCase(SwitchCase node)
422  {
423  return node.Update(Visit(node.TestValues), Visit(node.Body));
424  }
425 
429  [global::__DynamicallyInvokable]
430  protected internal virtual Expression VisitSwitch(SwitchExpression node)
431  {
432  return ValidateSwitch(node, node.Update(Visit(node.SwitchValue), Visit(node.Cases, VisitSwitchCase), Visit(node.DefaultBody)));
433  }
434 
438  [global::__DynamicallyInvokable]
439  protected virtual CatchBlock VisitCatchBlock(CatchBlock node)
440  {
441  return node.Update(VisitAndConvert(node.Variable, "VisitCatchBlock"), Visit(node.Filter), Visit(node.Body));
442  }
443 
447  [global::__DynamicallyInvokable]
448  protected internal virtual Expression VisitTry(TryExpression node)
449  {
450  return node.Update(Visit(node.Body), Visit(node.Handlers, VisitCatchBlock), Visit(node.Finally), Visit(node.Fault));
451  }
452 
456  [global::__DynamicallyInvokable]
457  protected internal virtual Expression VisitTypeBinary(TypeBinaryExpression node)
458  {
459  return node.Update(Visit(node.Expression));
460  }
461 
465  [global::__DynamicallyInvokable]
466  protected internal virtual Expression VisitUnary(UnaryExpression node)
467  {
468  return ValidateUnary(node, node.Update(Visit(node.Operand)));
469  }
470 
474  [global::__DynamicallyInvokable]
475  protected internal virtual Expression VisitMemberInit(MemberInitExpression node)
476  {
477  return node.Update(VisitAndConvert(node.NewExpression, "VisitMemberInit"), Visit(node.Bindings, VisitMemberBinding));
478  }
479 
483  [global::__DynamicallyInvokable]
484  protected internal virtual Expression VisitListInit(ListInitExpression node)
485  {
486  return node.Update(VisitAndConvert(node.NewExpression, "VisitListInit"), Visit(node.Initializers, VisitElementInit));
487  }
488 
492  [global::__DynamicallyInvokable]
493  protected virtual ElementInit VisitElementInit(ElementInit node)
494  {
495  return node.Update(Visit(node.Arguments));
496  }
497 
501  [global::__DynamicallyInvokable]
503  {
504  switch (node.BindingType)
505  {
506  case MemberBindingType.Assignment:
508  case MemberBindingType.MemberBinding:
510  case MemberBindingType.ListBinding:
512  default:
513  throw Error.UnhandledBindingType(node.BindingType);
514  }
515  }
516 
520  [global::__DynamicallyInvokable]
522  {
523  return node.Update(Visit(node.Expression));
524  }
525 
529  [global::__DynamicallyInvokable]
531  {
532  return node.Update(Visit(node.Bindings, VisitMemberBinding));
533  }
534 
538  [global::__DynamicallyInvokable]
540  {
541  return node.Update(Visit(node.Initializers, VisitElementInit));
542  }
543 
544  private static UnaryExpression ValidateUnary(UnaryExpression before, UnaryExpression after)
545  {
546  if (before != after && before.Method == null)
547  {
548  if (after.Method != null)
549  {
550  throw Error.MustRewriteWithoutMethod(after.Method, "VisitUnary");
551  }
552  if (before.Operand != null && after.Operand != null)
553  {
554  ValidateChildType(before.Operand.Type, after.Operand.Type, "VisitUnary");
555  }
556  }
557  return after;
558  }
559 
560  private static BinaryExpression ValidateBinary(BinaryExpression before, BinaryExpression after)
561  {
562  if (before != after && before.Method == null)
563  {
564  if (after.Method != null)
565  {
566  throw Error.MustRewriteWithoutMethod(after.Method, "VisitBinary");
567  }
568  ValidateChildType(before.Left.Type, after.Left.Type, "VisitBinary");
569  ValidateChildType(before.Right.Type, after.Right.Type, "VisitBinary");
570  }
571  return after;
572  }
573 
574  private static SwitchExpression ValidateSwitch(SwitchExpression before, SwitchExpression after)
575  {
576  if (before.Comparison == null && after.Comparison != null)
577  {
578  throw Error.MustRewriteWithoutMethod(after.Comparison, "VisitSwitch");
579  }
580  return after;
581  }
582 
583  private static void ValidateChildType(Type before, Type after, string methodName)
584  {
585  if (before.IsValueType)
586  {
587  if (TypeUtils.AreEquivalent(before, after))
588  {
589  return;
590  }
591  }
592  else if (!after.IsValueType)
593  {
594  return;
595  }
596  throw Error.MustRewriteChildToSameType(before, after, methodName);
597  }
598  }
599 }
LabelTarget BreakLabel
Gets the T:System.Linq.Expressions.LabelTarget that is used by the loop body as a break statement tar...
Represents an expression that has a constant value.
virtual internal Expression VisitTry(TryExpression node)
Visits the children of the T:System.Linq.Expressions.TryExpression.
LabelTarget Target
The T:System.Linq.Expressions.LabelTarget which this label is associated with.
MemberMemberBinding Update(IEnumerable< MemberBinding > bindings)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
ListInitExpression Update(NewExpression newExpression, IEnumerable< ElementInit > initializers)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
virtual MemberBinding VisitMemberBinding(MemberBinding node)
Visits the children of the T:System.Linq.Expressions.MemberBinding.
Expression Expression
Gets the delegate or lambda expression to be applied.
Emits or clears a sequence point for debug information. This allows the debugger to highlight the cor...
Expression Right
Gets the right operand of the binary operation.
virtual LabelTarget VisitLabelTarget(LabelTarget node)
Visits the T:System.Linq.Expressions.LabelTarget.
ReadOnlyCollection< MemberBinding > Bindings
Gets the bindings that describe how to initialize the members of the newly created object.
ReadOnlyCollection< SwitchCase > Cases
Gets the collection of T:System.Linq.Expressions.SwitchCase objects for the switch.
SwitchExpression Update(Expression switchValue, IEnumerable< SwitchCase > cases, Expression defaultBody)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
MemberBindingType BindingType
Gets the type of binding that is represented.
TypeBinaryExpression Update(Expression expression)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Represents an infinite loop. It can be exited with "break".
virtual internal Expression VisitInvocation(InvocationExpression node)
Visits the children of the T:System.Linq.Expressions.InvocationExpression.
Expression Expression
Gets the containing object of the field or property.
Represents accessing a field or property.
virtual internal Expression VisitGoto(GotoExpression node)
Visits the children of the T:System.Linq.Expressions.GotoExpression.
Expression Body
Gets the T:System.Linq.Expressions.Expression representing the body of the try block.
Expression Test
Gets the test of the conditional operation.
Expression DefaultValue
The value of the T:System.Linq.Expressions.LabelExpression when the label is reached through regular ...
ReadOnlyCollection< Expression > Visit(ReadOnlyCollection< Expression > nodes)
Dispatches the list of expressions to one of the more specialized visit methods in this class.
Provides the base class for a generic read-only collection.
ElementInit Update(IEnumerable< Expression > arguments)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Definition: ElementInit.cs:78
Represents a constructor call.
Represents creating a new array and possibly initializing the elements of the new array.
Represents calling a constructor and initializing one or more members of the new object.
LabelTarget Target
The target label where this node jumps to.
virtual internal Expression VisitDynamic(DynamicExpression node)
Visits the children of the T:System.Linq.Expressions.DynamicExpression.
Expression Filter
Gets the body of the T:System.Linq.Expressions.CatchBlock filter.
Definition: CatchBlock.cs:58
Expression Value
The value passed to the target, or null if the target is of type System.Void.
Provides an internal interface for accessing the arguments of multiple tree nodes (DynamicExpression,...
Represents a block that contains a sequence of expressions where variables can be defined.
LoopExpression Update(LabelTarget breakLabel, LabelTarget continueLabel, Expression body)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Definition: __Canon.cs:3
RuntimeVariablesExpression Update(IEnumerable< ParameterExpression > variables)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
BinaryExpression Update(Expression left, LambdaExpression conversion, Expression right)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Represents initializing the elements of a collection member of a newly created object.
Represents a label, which can be put in any T:System.Linq.Expressions.Expression context....
Represents an expression that applies a delegate or lambda expression to a list of argument expressio...
int Count
Gets the number of elements contained in the T:System.Collections.ObjectModel.ReadOnlyCollection`1 in...
TryExpression Update(Expression body, IEnumerable< CatchBlock > handlers, Expression @finally, Expression fault)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Expression SwitchValue
Gets the test for the switch.
Expression Object
Gets the T:System.Linq.Expressions.Expression that represents the instance for instance method calls ...
NewExpression Update(IEnumerable< Expression > arguments)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
LabelTarget ContinueLabel
Gets the T:System.Linq.Expressions.LabelTarget that is used by the loop body as a continue statement ...
int ArgumentCount
Returns the number of arguments to the expression tree node. You should not use this type....
Used to represent the target of a T:System.Linq.Expressions.GotoExpression.
Definition: LabelTarget.cs:5
Expression Body
Gets the body of the catch block.
Definition: CatchBlock.cs:46
virtual internal Expression VisitConstant(ConstantExpression node)
Visits the T:System.Linq.Expressions.ConstantExpression.
GotoExpression Update(LabelTarget target, Expression value)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Expression GetArgument(int index)
Returns the argument at index, throwing if index is out of bounds. You should not use this type....
virtual internal Expression VisitLoop(LoopExpression node)
Visits the children of the T:System.Linq.Expressions.LoopExpression.
virtual internal Expression VisitMemberInit(MemberInitExpression node)
Visits the children of the T:System.Linq.Expressions.MemberInitExpression.
CatchBlock Update(ParameterExpression variable, Expression filter, Expression body)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Definition: CatchBlock.cs:88
virtual internal Expression VisitListInit(ListInitExpression node)
Visits the children of the T:System.Linq.Expressions.ListInitExpression.
NewExpression NewExpression
Gets the expression that represents the constructor call.
virtual internal Expression VisitExtension(Expression node)
Visits the children of the extension expression.
ReadOnlyCollection< Expression > Arguments
Gets the collection of arguments that are passed to a method that adds an element to an T:System....
Definition: ElementInit.cs:31
Provides the base class from which the classes that represent bindings that are used to initialize me...
Definition: MemberBinding.cs:7
static ReadOnlyCollection< T > Visit< T >(ReadOnlyCollection< T > nodes, Func< T, T > elementVisitor)
Visits all nodes in the collection using a specified element visitor.
Provides the base class from which the classes that represent expression tree nodes are derived....
Definition: Expression.cs:17
Represents an unconditional jump. This includes return statements, break and continue statements,...
An expression that provides runtime read/write permission for variables.
Expression Body
Gets the T:System.Linq.Expressions.Expression that is the body of the loop.
MemberListBinding Update(IEnumerable< ElementInit > initializers)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
MemberBindingType
Describes the binding types that are used in T:System.Linq.Expressions.MemberInitExpression objects.
virtual CatchBlock VisitCatchBlock(CatchBlock node)
Visits the children of the T:System.Linq.Expressions.CatchBlock.
NewArrayExpression Update(IEnumerable< Expression > expressions)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
T VisitAndConvert< T >(T node, string callerName)
Visits an expression, casting the result back to the original expression type.
NewExpression NewExpression
Gets the expression that contains a call to the constructor of a collection type.
ConditionalExpression Update(Expression test, Expression ifTrue, Expression ifFalse)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
LambdaExpression Conversion
Gets the type conversion function that is used by a coalescing or compound assignment operation.
Represents initializing members of a member of a newly created object.
Represents an initializer for a single element of an T:System.Collections.IEnumerable collection.
Definition: ElementInit.cs:9
ReadOnlyCollection< ElementInit > Initializers
Gets the element initializers for initializing a collection member of a newly created object.
virtual internal Expression VisitLabel(LabelExpression node)
Visits the children of the T:System.Linq.Expressions.LabelExpression.
Expression IfFalse
Gets the expression to execute if the test evaluates to false.
Represents a constructor call that has a collection initializer.
ParameterExpression Variable
Gets a reference to the T:System.Exception object caught by this handler.
Definition: CatchBlock.cs:22
virtual internal Expression VisitConditional(ConditionalExpression node)
Visits the children of the T:System.Linq.Expressions.ConditionalExpression.
ReadOnlyCollection< CatchBlock > Handlers
Gets the collection of T:System.Linq.Expressions.CatchBlock expressions associated with the try block...
Represents a control expression that handles multiple selections by passing control to T:System....
Represents a named parameter expression.
virtual internal Expression VisitLambda< T >(Expression< T > node)
Visits the children of the T:System.Linq.Expressions.Expression`1.
Represents assignment operation for a field or property of an object.
Expression Expression
Gets the expression operand of a type test operation.
Expression Object
An object to index.
virtual Expression Visit(Expression node)
Dispatches the expression to one of the more specialized visit methods in this class.
ReadOnlyCollection< ParameterExpression > Variables
The variables or parameters to which to provide runtime access.
ExpressionVisitor()
Initializes a new instance of T:System.Linq.Expressions.ExpressionVisitor.
Expression Expression
Gets the expression to assign to the field or property.
virtual internal Expression VisitBinary(BinaryExpression node)
Visits the children of the T:System.Linq.Expressions.BinaryExpression.
virtual internal Expression VisitUnary(UnaryExpression node)
Visits the children of the T:System.Linq.Expressions.UnaryExpression.
Represents one case of a T:System.Linq.Expressions.SwitchExpression.
Definition: SwitchCase.cs:10
Expression DefaultBody
Gets the test for the switch.
Expression Fault
Gets the T:System.Linq.Expressions.Expression representing the fault block.
Represents an operation between an expression and a type.
Expression IfTrue
Gets the expression to execute if the test evaluates to true.
Represents a try/catch/finally/fault block.
ReadOnlyCollection< Expression > Expressions
Gets the bounds of the array if the value of the P:System.Linq.Expressions.Expression....
ReadOnlyCollection< MemberBinding > Bindings
Gets the bindings that describe how to initialize the members of a member.
virtual internal Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
Visits the children of the T:System.Linq.Expressions.RuntimeVariablesExpression.
Represents the default value of a type or an empty expression.
MemberInitExpression Update(NewExpression newExpression, IEnumerable< MemberBinding > bindings)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
MethodInfo Method
Gets the implementing method for the unary operation.
UnaryExpression Update(Expression operand)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
virtual internal Expression VisitBlock(BlockExpression node)
Visits the children of the T:System.Linq.Expressions.BlockExpression.
Represents a dynamic operation.
virtual internal Expression VisitParameter(ParameterExpression node)
Visits the T:System.Linq.Expressions.ParameterExpression.
virtual ElementInit VisitElementInit(ElementInit node)
Visits the children of the T:System.Linq.Expressions.ElementInit.
Represents indexing a property or array.
SwitchCase Update(IEnumerable< Expression > testValues, Expression body)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Definition: SwitchCase.cs:59
Represents an expression that has a unary operator.
virtual MemberAssignment VisitMemberAssignment(MemberAssignment node)
Visits the children of the T:System.Linq.Expressions.MemberAssignment.
Represents a catch statement in a try block.
Definition: CatchBlock.cs:8
virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding node)
Visits the children of the T:System.Linq.Expressions.MemberMemberBinding.
Expression Finally
Gets the T:System.Linq.Expressions.Expression representing the finally block.
Expression Body
Gets the body of this case.
Definition: SwitchCase.cs:32
ReadOnlyCollection< ElementInit > Initializers
Gets the element initializers that are used to initialize a collection.
Represents an expression that has a binary operator.
Expression Left
Gets the left operand of the binary operation.
Represents a call to either static or an instance method.
Represents an expression that has a conditional operator.
virtual internal Expression VisitMethodCall(MethodCallExpression node)
Visits the children of the T:System.Linq.Expressions.MethodCallExpression.
virtual internal Expression VisitDebugInfo(DebugInfoExpression node)
Visits the T:System.Linq.Expressions.DebugInfoExpression.
virtual MemberListBinding VisitMemberListBinding(MemberListBinding node)
Visits the children of the T:System.Linq.Expressions.MemberListBinding.
virtual internal Expression VisitTypeBinary(TypeBinaryExpression node)
Visits the children of the T:System.Linq.Expressions.TypeBinaryExpression.
ReadOnlyCollection< ParameterExpression > Variables
Gets the variables defined in this block.
ReadOnlyCollection< Expression > Arguments
Gets the arguments to the constructor.
virtual internal Expression VisitNew(NewExpression node)
Visits the children of the T:System.Linq.Expressions.NewExpression.
Expression Operand
Gets the operand of the unary operation.
virtual internal Expression VisitMember(MemberExpression node)
Visits the children of the T:System.Linq.Expressions.MemberExpression.
virtual internal Expression VisitIndex(IndexExpression node)
Visits the children of the T:System.Linq.Expressions.IndexExpression.
virtual internal Expression VisitSwitch(SwitchExpression node)
Visits the children of the T:System.Linq.Expressions.SwitchExpression.
virtual SwitchCase VisitSwitchCase(SwitchCase node)
Visits the children of the T:System.Linq.Expressions.SwitchCase.
LabelExpression Update(LabelTarget target, Expression defaultValue)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
virtual internal Expression VisitDefault(DefaultExpression node)
Visits the T:System.Linq.Expressions.DefaultExpression.
virtual internal Expression VisitNewArray(NewArrayExpression node)
Visits the children of the T:System.Linq.Expressions.NewArrayExpression.
Represents a visitor or rewriter for expression trees.
MemberExpression Update(Expression expression)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
ReadOnlyCollection< Expression > TestValues
Gets the values of this case. This case is selected for execution when the P:System....
Definition: SwitchCase.cs:20
MemberAssignment Update(Expression expression)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...