TryStatementAst Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Construct a try statement ast.
public:
TryStatementAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Management::Automation::Language::StatementBlockAst ^ body, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::CatchClauseAst ^> ^ catchClauses, System::Management::Automation::Language::StatementBlockAst ^ finally);
public TryStatementAst (System.Management.Automation.Language.IScriptExtent extent, System.Management.Automation.Language.StatementBlockAst body, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.CatchClauseAst> catchClauses, System.Management.Automation.Language.StatementBlockAst finally);
new System.Management.Automation.Language.TryStatementAst : System.Management.Automation.Language.IScriptExtent * System.Management.Automation.Language.StatementBlockAst * seq<System.Management.Automation.Language.CatchClauseAst> * System.Management.Automation.Language.StatementBlockAst -> System.Management.Automation.Language.TryStatementAst
Public Sub New (extent As IScriptExtent, body As StatementBlockAst, catchClauses As IEnumerable(Of CatchClauseAst), finally As StatementBlockAst)
Parameters
- extent
- IScriptExtent
The extent of the try statement, from the try keyword to the closing curly of the last catch or finally.
- body
- StatementBlockAst
The region of guarded code.
- catchClauses
- IEnumerable<CatchClauseAst>
The list of catch clauses, may be null.
- finally
- StatementBlockAst
The finally clause, may be null.
Exceptions
If extent
or body
is null.
If catchClauses
is null or is an empty collection and finally
is also
null, then an exception is also raised as the try block must have a finally or at least one catch.