See Also: CodeTryCatchFinallyStatement Members
System.CodeDom.CodeTryCatchFinallyStatement can be used to represent a try/ catch block of code.
The CodeTryCatchFinallyStatement.TryStatements property contains the statements to execute within a try block. The CodeTryCatchFinallyStatement.CatchClauses property contains the catch clauses to handle caught exceptions. The CodeTryCatchFinallyStatement.FinallyStatements property contains the statements to execute within a finally block.
Not all languages support try/catch blocks. Call the System.CodeDom.Compiler.ICodeGenerator.Supports(System.CodeDom.Compiler.GeneratorSupport) method with the System.CodeDom.Compiler.GeneratorSupport.TryCatchStatements flag to determine whether a code generator supports try/catch blocks.