mscorlib(4.0.0.0) API with additions
LoopExpression.cs
1 using System.Diagnostics;
2 
4 {
6  [DebuggerTypeProxy(typeof(LoopExpressionProxy))]
7  [global::__DynamicallyInvokable]
8  public sealed class LoopExpression : Expression
9  {
10  private readonly Expression _body;
11 
12  private readonly LabelTarget _break;
13 
14  private readonly LabelTarget _continue;
15 
18  [global::__DynamicallyInvokable]
19  public sealed override Type Type
20  {
21  [global::__DynamicallyInvokable]
22  get
23  {
24  if (_break != null)
25  {
26  return _break.Type;
27  }
28  return typeof(void);
29  }
30  }
31 
34  [global::__DynamicallyInvokable]
35  public sealed override ExpressionType NodeType
36  {
37  [global::__DynamicallyInvokable]
38  get
39  {
40  return ExpressionType.Loop;
41  }
42  }
43 
46  [global::__DynamicallyInvokable]
47  public Expression Body
48  {
49  [global::__DynamicallyInvokable]
50  get
51  {
52  return _body;
53  }
54  }
55 
58  [global::__DynamicallyInvokable]
59  public LabelTarget BreakLabel
60  {
61  [global::__DynamicallyInvokable]
62  get
63  {
64  return _break;
65  }
66  }
67 
70  [global::__DynamicallyInvokable]
72  {
73  [global::__DynamicallyInvokable]
74  get
75  {
76  return _continue;
77  }
78  }
79 
80  internal LoopExpression(Expression body, LabelTarget @break, LabelTarget @continue)
81  {
82  _body = body;
83  _break = @break;
84  _continue = @continue;
85  }
86 
87  protected internal override Expression Accept(ExpressionVisitor visitor)
88  {
89  return visitor.VisitLoop(this);
90  }
91 
97  [global::__DynamicallyInvokable]
98  public LoopExpression Update(LabelTarget breakLabel, LabelTarget continueLabel, Expression body)
99  {
100  if (breakLabel == BreakLabel && continueLabel == ContinueLabel && body == Body)
101  {
102  return this;
103  }
104  return Expression.Loop(body, breakLabel, continueLabel);
105  }
106  }
107 }
LabelTarget BreakLabel
Gets the T:System.Linq.Expressions.LabelTarget that is used by the loop body as a break statement tar...
Represents an infinite loop. It can be exited with "break".
sealed override ExpressionType NodeType
Returns the node type of this expression. Extension nodes should return F:System.Linq....
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
LabelTarget ContinueLabel
Gets the T:System.Linq.Expressions.LabelTarget that is used by the loop body as a continue statement ...
Used to represent the target of a T:System.Linq.Expressions.GotoExpression.
Definition: LabelTarget.cs:5
Provides the base class from which the classes that represent expression tree nodes are derived....
Definition: Expression.cs:17
Expression Body
Gets the T:System.Linq.Expressions.Expression that is the body of the loop.
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.