CxExpressionNew

Description

sealed class Tinman.Core.Cx.Expressions.CxExpressionNew

Represents an expression that creates an object or array from zero or more arguments or an array of the given length:

new Type(argument0, argument1, ..., argumentN)
new Type[] { argument0, argument1, ..., argumentN }
new Type[length]

ICxTypeContainer.Type returns the type of the created object or the type of the created array.

Public / Constructors

Cx​Expression​New

2 overloads


public constructor CxExpressionNew1 → (2)

type in : CxType

[not-null]
The type to instantiate (CxType.CanNew must return true).

arguments opt : IBagConst<CxExpression> = null

The constructor argument list or array initializer list or null for an empty list. See Arguments.

Creates a new instance of CxExpressionNew.


public constructor CxExpressionNew2 → (2)

type in : CxTypeArray

[not-null]
The array type. See ICxTypeContainer.Type.

length in : CxExpression

[not-null]
The array length expression. See Length.

Creates a new instance of CxExpressionNew.

Public / Methods

Add


public method Add → (1)

argument in : CxExpression

[not-null]
The argument expression to append.

returns → CxExpression

The appended argument expression.

Appends the given argument expression.

Public / Attributes

Arguments


[Constant]
public attribute Arguments → (get)

value : IVectorConst<CxExpression>

The expression list or null iff Length is not null.

Returns the constructor argument list or array initializer list.

Is​Array​Creation


[Constant]
public attribute IsArrayCreation → (get)

value : bool

true if this expression creates an array,
false if this expression creates an object.

Is this an array creation expression?

Is​Object​Creation


[Constant]
public attribute IsObjectCreation → (get)

value : bool

true if this expression creates an object,
false if this expression creates an array.

Is this an object creation expression?

Length


[Constant]
public attribute Length → (get)

value : CxExpression

The array length expression or null iff Arguments is not null.

Returns the array length expression.