System.CodeDom.CodeTryCatchFinallyStatement Class

Represents a try block with any number of catch clauses and, optionally, a finally block.

See Also: CodeTryCatchFinallyStatement Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class CodeTryCatchFinallyStatement : CodeStatement

Remarks

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.

Note:

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.

Requirements

Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0, 4.0.0.0