IfStatementAst Constructor

Definition

Construct an if statement.

public:
 IfStatementAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Collections::Generic::IEnumerable<Tuple<System::Management::Automation::Language::PipelineBaseAst ^, System::Management::Automation::Language::StatementBlockAst ^> ^> ^ clauses, System::Management::Automation::Language::StatementBlockAst ^ elseClause);
public IfStatementAst (System.Management.Automation.Language.IScriptExtent extent, System.Collections.Generic.IEnumerable<Tuple<System.Management.Automation.Language.PipelineBaseAst,System.Management.Automation.Language.StatementBlockAst>> clauses, System.Management.Automation.Language.StatementBlockAst elseClause);
new System.Management.Automation.Language.IfStatementAst : System.Management.Automation.Language.IScriptExtent * seq<System.Management.Automation.Language.PipelineBaseAst * System.Management.Automation.Language.StatementBlockAst> * System.Management.Automation.Language.StatementBlockAst -> System.Management.Automation.Language.IfStatementAst
Public Sub New (extent As IScriptExtent, clauses As IEnumerable(Of Tuple(Of PipelineBaseAst, StatementBlockAst)), elseClause As StatementBlockAst)

Parameters

extent
IScriptExtent

The extent of the statement, starting with the if keyword, ending at the closing curly of the last clause.

clauses
IEnumerable<Tuple<PipelineBaseAst,StatementBlockAst>>

A non-empty collection of pairs of condition expressions and statement blocks.

elseClause
StatementBlockAst

The else clause, or null if no clause was specified.

Exceptions

If extent is null.

If clauses is null or empty.

Applies to