Class NewExpressionSlim
Lightweight representation of object creation expression tree nodes.
Implements
Inherited Members
Namespace: System.Linq.Expressions
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public abstract class NewExpressionSlim : ExpressionSlim, IArgumentProviderSlim
Constructors
NewExpressionSlim()
Declaration
protected NewExpressionSlim()
Properties
ArgumentCount
Gets the number of arguments.
Declaration
public abstract int ArgumentCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Arguments
Gets the expressions representing the arguments passed to the constructor call.
Declaration
public ReadOnlyCollection<ExpressionSlim> Arguments { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ExpressionSlim> |
Constructor
Gets the constructor used by the object creation operation.
Declaration
public abstract ConstructorInfoSlim Constructor { get; }
Property Value
Type | Description |
---|---|
ConstructorInfoSlim |
Members
Gets the members initialized by the constructor arguments.
Declaration
public abstract ReadOnlyCollection<MemberInfoSlim> Members { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<MemberInfoSlim> |
NodeType
Gets the expression node type.
Declaration
public override ExpressionType NodeType { get; }
Property Value
Type | Description |
---|---|
System.Linq.Expressions.ExpressionType |
Overrides
Type
Gets the type of the new expression.
Declaration
public abstract TypeSlim Type { get; }
Property Value
Type | Description |
---|---|
TypeSlim |
Methods
Accept(ExpressionSlimVisitor)
Accepts the expression tree node in the specified visitor.
Declaration
protected override ExpressionSlim Accept(ExpressionSlimVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlimVisitor | visitor | Visitor to process the current expression tree node. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
Overrides
Accept<TExpression, TLambdaExpression, TParameterExpression, TNewExpression, TElementInit, TMemberBinding, TMemberAssignment, TMemberListBinding, TMemberMemberBinding, TCatchBlock, TSwitchCase, TLabelTarget>(ExpressionSlimVisitor<TExpression, TLambdaExpression, TParameterExpression, TNewExpression, TElementInit, TMemberBinding, TMemberAssignment, TMemberListBinding, TMemberMemberBinding, TCatchBlock, TSwitchCase, TLabelTarget>)
Accepts the expression tree node in the specified visitor.
Declaration
protected override TExpression Accept<TExpression, TLambdaExpression, TParameterExpression, TNewExpression, TElementInit, TMemberBinding, TMemberAssignment, TMemberListBinding, TMemberMemberBinding, TCatchBlock, TSwitchCase, TLabelTarget>(ExpressionSlimVisitor<TExpression, TLambdaExpression, TParameterExpression, TNewExpression, TElementInit, TMemberBinding, TMemberAssignment, TMemberListBinding, TMemberMemberBinding, TCatchBlock, TSwitchCase, TLabelTarget> visitor)
where TLambdaExpression : TExpression where TParameterExpression : TExpression where TNewExpression : TExpression where TMemberAssignment : TMemberBinding where TMemberListBinding : TMemberBinding where TMemberMemberBinding : TMemberBinding
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlimVisitor<TExpression, TLambdaExpression, TParameterExpression, TNewExpression, TElementInit, TMemberBinding, TMemberAssignment, TMemberListBinding, TMemberMemberBinding, TCatchBlock, TSwitchCase, TLabelTarget> | visitor | Visitor to process the current expression tree node. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the node. |
Type Parameters
Name | Description |
---|---|
TExpression | Target type for expressions. |
TLambdaExpression | Target type for lambda expressions. This type has to derive from TExpression. |
TParameterExpression | Target type for parameter expressions. This type has to derive from TExpression. |
TNewExpression | Target type for new expressions. This type has to derive from TExpression. |
TElementInit | Target type for element initializers. |
TMemberBinding | Target type for member bindings. |
TMemberAssignment | Target type for member assignments. This type has to derive from TMemberBinding. |
TMemberListBinding | Target type for member list bindings. This type has to derive from TMemberBinding. |
TMemberMemberBinding | Target type for member member bindings. This type has to derive from TMemberBinding. |
TCatchBlock | Target type for catch blocks. |
TSwitchCase | Target type for switch cases. |
TLabelTarget | Target type for label targets. |
Overrides
GetArgument(Int32)
Gets the argument at the specified index.
Declaration
public abstract ExpressionSlim GetArgument(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the argument to retrieve. |
Returns
Type | Description |
---|---|
ExpressionSlim | The argument at the specified index. |
GetOrMakeArguments()
Gets or makes the arguments collection. This supports efficient layouts of subtypes.
Declaration
protected abstract ReadOnlyCollection<ExpressionSlim> GetOrMakeArguments()
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ExpressionSlim> | The arguments collection. |
Update(ReadOnlyCollection<ExpressionSlim>)
Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
Declaration
public NewExpressionSlim Update(ReadOnlyCollection<ExpressionSlim> arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ExpressionSlim> | arguments | The Arguments child node of the result. |
Returns
Type | Description |
---|---|
NewExpressionSlim | This expression if no children are changed or an expression with the updated children. |