CodeTryCatchFinallyStatement.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // System.CodeDom CodeTryCatchFinallyStatement Class implementation
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. // Daniel Stodden ([email protected])
  7. //
  8. // (C) 2001 Ximian, Inc.
  9. //
  10. using System.Runtime.InteropServices;
  11. namespace System.CodeDom
  12. {
  13. [Serializable]
  14. [ClassInterface(ClassInterfaceType.AutoDispatch)]
  15. [ComVisible(true)]
  16. public class CodeTryCatchFinallyStatement
  17. : CodeStatement
  18. {
  19. private CodeStatementCollection tryStatements, finallyStatements;
  20. private CodeCatchClauseCollection catchClauses;
  21. //
  22. // Constructors
  23. //
  24. public CodeTryCatchFinallyStatement ()
  25. {
  26. }
  27. public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
  28. CodeCatchClause [] catchClauses)
  29. {
  30. TryStatements.AddRange( tryStatements );
  31. CatchClauses.AddRange( catchClauses );
  32. }
  33. public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
  34. CodeCatchClause [] catchClauses,
  35. CodeStatement [] finallyStatements)
  36. {
  37. TryStatements.AddRange( tryStatements );
  38. CatchClauses.AddRange( catchClauses );
  39. FinallyStatements.AddRange( finallyStatements );
  40. }
  41. //
  42. // Properties
  43. //
  44. public CodeStatementCollection FinallyStatements{
  45. get {
  46. if ( finallyStatements == null )
  47. finallyStatements = new CodeStatementCollection();
  48. return finallyStatements;
  49. }
  50. }
  51. public CodeStatementCollection TryStatements {
  52. get {
  53. if ( tryStatements == null )
  54. tryStatements = new CodeStatementCollection();
  55. return tryStatements;
  56. }
  57. }
  58. public CodeCatchClauseCollection CatchClauses {
  59. get {
  60. if ( catchClauses == null )
  61. catchClauses = new CodeCatchClauseCollection();
  62. return catchClauses;
  63. }
  64. }
  65. }
  66. }