Represents a list of statements that can be used in contexts requiring multiple statements, such as switch case sections or block contents.
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
public interface IStatementListRemarks
IStatementList is a compile-time abstraction over a sequence of statements. Unlike regular collections, statement lists cannot be enumerated at compile time because they are evaluated lazily when the statements are inserted into the target syntax tree.
To create an IStatementList, use one of the following methods:
<ul><li><xref href="Metalama.Framework.Code.SyntaxBuilders.StatementFactory.List(Metalama.Framework.Code.SyntaxBuilders.IStatement%5b%5d)" data-throw-if-not-resolved="false"></xref> - Create a list from a fixed array of statements</li><li><xref href="Metalama.Framework.Code.SyntaxBuilders.StatementListBuilder" data-throw-if-not-resolved="false"></xref> - Build a list dynamically when the statements are determined at compile time</li><li><xref href="Metalama.Framework.Code.SyntaxBuilders.StatementFactory.UnwrapBlock(Metalama.Framework.Code.SyntaxBuilders.IStatement)" data-throw-if-not-resolved="false"></xref> - Extract the statement list from a block statement</li><li><xref href="Metalama.Framework.Code.SyntaxBuilders.StatementExtensions.AsList(Metalama.Framework.Code.SyntaxBuilders.IStatement)" data-throw-if-not-resolved="false"></xref> - Convert a single statement into a singleton list</li></ul></p>