SyntaxFactory.TryBlock Method
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.
Overloads
TryBlock(TryStatementSyntax, SyntaxList<StatementSyntax>, SyntaxList<CatchBlockSyntax>, FinallyBlockSyntax, EndBlockStatementSyntax) |
Represents a "Try ... Catch ... Finally ... End Try" block. |
TryBlock() |
Represents a "Try ... Catch ... Finally ... End Try" block. |
TryBlock(SyntaxList<StatementSyntax>, SyntaxList<CatchBlockSyntax>, FinallyBlockSyntax) |
Represents a "Try ... Catch ... Finally ... End Try" block. |
TryBlock(TryStatementSyntax, SyntaxList<StatementSyntax>, SyntaxList<CatchBlockSyntax>, FinallyBlockSyntax, EndBlockStatementSyntax)
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
Represents a "Try ... Catch ... Finally ... End Try" block.
public:
static Microsoft::CodeAnalysis::VisualBasic::Syntax::TryBlockSyntax ^ TryBlock(Microsoft::CodeAnalysis::VisualBasic::Syntax::TryStatementSyntax ^ tryStatement, Microsoft::CodeAnalysis::SyntaxList<Microsoft::CodeAnalysis::VisualBasic::Syntax::StatementSyntax ^> statements, Microsoft::CodeAnalysis::SyntaxList<Microsoft::CodeAnalysis::VisualBasic::Syntax::CatchBlockSyntax ^> catchBlocks, Microsoft::CodeAnalysis::VisualBasic::Syntax::FinallyBlockSyntax ^ finallyBlock, Microsoft::CodeAnalysis::VisualBasic::Syntax::EndBlockStatementSyntax ^ endTryStatement);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax TryBlock (Microsoft.CodeAnalysis.VisualBasic.Syntax.TryStatementSyntax tryStatement, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.StatementSyntax> statements, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.CatchBlockSyntax> catchBlocks, Microsoft.CodeAnalysis.VisualBasic.Syntax.FinallyBlockSyntax finallyBlock, Microsoft.CodeAnalysis.VisualBasic.Syntax.EndBlockStatementSyntax endTryStatement);
static member TryBlock : Microsoft.CodeAnalysis.VisualBasic.Syntax.TryStatementSyntax * Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.StatementSyntax> * Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.CatchBlockSyntax> * Microsoft.CodeAnalysis.VisualBasic.Syntax.FinallyBlockSyntax * Microsoft.CodeAnalysis.VisualBasic.Syntax.EndBlockStatementSyntax -> Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax
Public Shared Function TryBlock (tryStatement As TryStatementSyntax, statements As SyntaxList(Of StatementSyntax), catchBlocks As SyntaxList(Of CatchBlockSyntax), finallyBlock As FinallyBlockSyntax, endTryStatement As EndBlockStatementSyntax) As TryBlockSyntax
Parameters
- tryStatement
- TryStatementSyntax
The "Try" statement that begins the "Try" block.
- statements
- SyntaxList<StatementSyntax>
A list of statements to be executed.
- catchBlocks
- SyntaxList<CatchBlockSyntax>
A list of "Catch" blocks which may be executed if an exception is thrown while executing the statements in the "Try" block.
- finallyBlock
- FinallyBlockSyntax
A "Finally" block to be executed before execution leaves the "Try" block.
- endTryStatement
- EndBlockStatementSyntax
The "End Try" statement.
Returns
Applies to
TryBlock()
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
Represents a "Try ... Catch ... Finally ... End Try" block.
public:
static Microsoft::CodeAnalysis::VisualBasic::Syntax::TryBlockSyntax ^ TryBlock();
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax TryBlock ();
static member TryBlock : unit -> Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax
Public Shared Function TryBlock () As TryBlockSyntax
Returns
Applies to
TryBlock(SyntaxList<StatementSyntax>, SyntaxList<CatchBlockSyntax>, FinallyBlockSyntax)
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
- Source:
- Syntax.xml.Main.Generated.vb
Represents a "Try ... Catch ... Finally ... End Try" block.
public:
static Microsoft::CodeAnalysis::VisualBasic::Syntax::TryBlockSyntax ^ TryBlock(Microsoft::CodeAnalysis::SyntaxList<Microsoft::CodeAnalysis::VisualBasic::Syntax::StatementSyntax ^> statements, Microsoft::CodeAnalysis::SyntaxList<Microsoft::CodeAnalysis::VisualBasic::Syntax::CatchBlockSyntax ^> catchBlocks, Microsoft::CodeAnalysis::VisualBasic::Syntax::FinallyBlockSyntax ^ finallyBlock);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax TryBlock (Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.StatementSyntax> statements, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.CatchBlockSyntax> catchBlocks, Microsoft.CodeAnalysis.VisualBasic.Syntax.FinallyBlockSyntax finallyBlock);
static member TryBlock : Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.StatementSyntax> * Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.CatchBlockSyntax> * Microsoft.CodeAnalysis.VisualBasic.Syntax.FinallyBlockSyntax -> Microsoft.CodeAnalysis.VisualBasic.Syntax.TryBlockSyntax
Public Shared Function TryBlock (statements As SyntaxList(Of StatementSyntax), catchBlocks As SyntaxList(Of CatchBlockSyntax), finallyBlock As FinallyBlockSyntax) As TryBlockSyntax
Parameters
- statements
- SyntaxList<StatementSyntax>
A list of statements to be executed.
- catchBlocks
- SyntaxList<CatchBlockSyntax>
A list of "Catch" blocks which may be executed if an exception is thrown while executing the statements in the "Try" block.
- finallyBlock
- FinallyBlockSyntax
A "Finally" block to be executed before execution leaves the "Try" block.