Partager via


StatementBlockAst Constructor

Definition

Construct a statement block.

public:
 StatementBlockAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::StatementAst ^> ^ statements, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::TrapStatementAst ^> ^ traps);
public StatementBlockAst (System.Management.Automation.Language.IScriptExtent extent, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.StatementAst> statements, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.TrapStatementAst> traps);
new System.Management.Automation.Language.StatementBlockAst : System.Management.Automation.Language.IScriptExtent * seq<System.Management.Automation.Language.StatementAst> * seq<System.Management.Automation.Language.TrapStatementAst> -> System.Management.Automation.Language.StatementBlockAst
Public Sub New (extent As IScriptExtent, statements As IEnumerable(Of StatementAst), traps As IEnumerable(Of TrapStatementAst))

Parameters

extent
IScriptExtent

The extent of the statement block. If curly braces are part of the statement block (and not some other ast like in a script block), then the curly braces are included in the extent, otherwise the extent runs from the first statement or trap to the last statement or trap.

statements
IEnumerable<StatementAst>

The (possibly null) collection of statements.

traps
IEnumerable<TrapStatementAst>

The (possibly null) collection of trap statements.

Exceptions

If extent is null.

Applies to