Open sandboxFocus

Method List

List(params IStatement[])

Creates an IStatementList from a collection of statements.

Declaration
public static IStatementList List(params IStatement[] statements)
Parameters
Type Name Description
IStatement[] statements

The statements to include in the list.

Returns
Type Description
IStatementList

An IStatementList containing the specified statements.

Remarks

Statement lists are used with methods like Block(IStatementList) or in switch case sections. Unlike blocks, statement lists don't add braces around the statements. Use StatementListBuilder when you need to build the list dynamically at compile time.

See Also

List(IEnumerable<IStatement>)

Creates an IStatementList from a list of IStatement.

Declaration
public static IStatementList List(IEnumerable<IStatement> statements)
Parameters
Type Name Description
IEnumerable<IStatement> statements
Returns
Type Description
IStatementList