System.CodeDom.CodeArrayCreateExpression Class

Represents an expression that creates an array.

See Also: CodeArrayCreateExpression Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class CodeArrayCreateExpression : CodeExpression

Remarks

System.CodeDom.CodeArrayCreateExpression can be used to represent a code expression that creates an array. Expressions that create an array should specify either a number of elements, or a list of expressions to use to initialize the array.

Most arrays can be initialized immediately following declaration. The CodeArrayCreateExpression.Initializers property can be set to the expression to use to initialize the array.

A System.CodeDom.CodeArrayCreateExpression only directly supports creating single-dimension arrays. If a language allows arrays of arrays, it is possible to create them by nesting a System.CodeDom.CodeArrayCreateExpression within a System.CodeDom.CodeArrayCreateExpression. Not all languages support arrays of arrays. You can check whether an System.CodeDom.Compiler.ICodeGenerator for a language declares support for nested arrays by calling System.CodeDom.Compiler.ICodeGenerator.Supports(System.CodeDom.Compiler.GeneratorSupport) with the System.CodeDom.Compiler.GeneratorSupport.ArraysOfArrays flag.

Requirements

Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0, 4.0.0.0