mscorlib(4.0.0.0) API with additions
LabelExpression.cs
1 using System.Diagnostics;
2 
4 {
6  [DebuggerTypeProxy(typeof(LabelExpressionProxy))]
7  [global::__DynamicallyInvokable]
8  public sealed class LabelExpression : Expression
9  {
10  private readonly Expression _defaultValue;
11 
12  private readonly LabelTarget _target;
13 
16  [global::__DynamicallyInvokable]
17  public sealed override Type Type
18  {
19  [global::__DynamicallyInvokable]
20  get
21  {
22  return _target.Type;
23  }
24  }
25 
28  [global::__DynamicallyInvokable]
29  public sealed override ExpressionType NodeType
30  {
31  [global::__DynamicallyInvokable]
32  get
33  {
34  return ExpressionType.Label;
35  }
36  }
37 
40  [global::__DynamicallyInvokable]
41  public LabelTarget Target
42  {
43  [global::__DynamicallyInvokable]
44  get
45  {
46  return _target;
47  }
48  }
49 
52  [global::__DynamicallyInvokable]
54  {
55  [global::__DynamicallyInvokable]
56  get
57  {
58  return _defaultValue;
59  }
60  }
61 
62  internal LabelExpression(LabelTarget label, Expression defaultValue)
63  {
64  _target = label;
65  _defaultValue = defaultValue;
66  }
67 
68  protected internal override Expression Accept(ExpressionVisitor visitor)
69  {
70  return visitor.VisitLabel(this);
71  }
72 
77  [global::__DynamicallyInvokable]
78  public LabelExpression Update(LabelTarget target, Expression defaultValue)
79  {
80  if (target == Target && defaultValue == DefaultValue)
81  {
82  return this;
83  }
84  return Expression.Label(target, defaultValue);
85  }
86  }
87 }
LabelTarget Target
The T:System.Linq.Expressions.LabelTarget which this label is associated with.
Expression DefaultValue
The value of the T:System.Linq.Expressions.LabelExpression when the label is reached through regular ...
Definition: __Canon.cs:3
Represents a label, which can be put in any T:System.Linq.Expressions.Expression context....
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
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.
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...
sealed override ExpressionType NodeType
Returns the node type of this T:System.Linq.Expressions.Expression.