Class LockExpression
Represents synchronized block of code.
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class LockExpression : Expression
Properties
| Improve this Doc View SourceBody
Gets body of the synchronized block of code.
Declaration
public Expression Body { get; }
Property Value
Type | Description |
---|---|
Expression |
CanReduce
Always returns true because
this expression is
Declaration
public override bool CanReduce { get; }
Property Value
Type | Description |
---|---|
Boolean |
NodeType
Always returns
Declaration
public override ExpressionType NodeType { get; }
Property Value
Type | Description |
---|---|
ExpressionType |
SyncRoot
Represents monitor object.
Declaration
public ParameterExpression SyncRoot { get; }
Property Value
Type | Description |
---|---|
ParameterExpression |
Type
Gets type of this expression.
Declaration
public override Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceCreate(Expression, LockExpression.Statement)
Creates a new synchronized block of code.
Declaration
public static LockExpression Create(Expression syncRoot, LockExpression.Statement body)
Parameters
Type | Name | Description |
---|---|---|
Expression | syncRoot | The monitor object. |
LockExpression.Statement | body | The delegate used to construct synchronized block of code. |
Returns
Type | Description |
---|---|
LockExpression | The synchronized block of code. |
Create(Expression, Expression)
Creates a new synchronized block of code.
Declaration
public static LockExpression Create(Expression syncRoot, Expression body)
Parameters
Type | Name | Description |
---|---|---|
Expression | syncRoot | The monitor object. |
Expression | body | The body of the code block. |
Returns
Type | Description |
---|---|
LockExpression | The synchronized block of code. |
Reduce()
Translates this expression into predefined set of expressions using Lowering technique.
Declaration
public override Expression Reduce()
Returns
Type | Description |
---|---|
Expression | Translated expression. |
Update(Expression)
Reconstructs synchronized block of code with a new body.
Declaration
public LockExpression Update(Expression body)
Parameters
Type | Name | Description |
---|---|---|
Expression | body | The new body of the synchronized block of code. |
Returns
Type | Description |
---|---|
LockExpression | Updated expression. |