CodeIterationStatement.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // System.CodeDom CodeIterationStatement Class implementation
  3. //
  4. // Author:
  5. // Daniel Stodden ([email protected])
  6. //
  7. // (C) 2002 Ximian, Inc.
  8. //
  9. using System.Runtime.InteropServices;
  10. namespace System.CodeDom
  11. {
  12. [Serializable]
  13. [ClassInterface(ClassInterfaceType.AutoDispatch)]
  14. [ComVisible(true)]
  15. public class CodeIterationStatement
  16. : CodeStatement
  17. {
  18. private CodeStatement incrementStatement;
  19. private CodeStatement initStatement;
  20. private CodeStatementCollection statements;
  21. private CodeExpression testExpression;
  22. //
  23. // Constructors
  24. //
  25. public CodeIterationStatement()
  26. {
  27. }
  28. public CodeIterationStatement( CodeStatement initStatement,
  29. CodeExpression testExpression,
  30. CodeStatement incrementStatement,
  31. params CodeStatement[] statements )
  32. {
  33. this.initStatement = initStatement;
  34. this.testExpression = testExpression;
  35. this.incrementStatement = incrementStatement;
  36. this.Statements.AddRange( statements );
  37. }
  38. //
  39. // Properties
  40. //
  41. public CodeStatement IncrementStatement {
  42. get {
  43. return incrementStatement;
  44. }
  45. set {
  46. incrementStatement = value;
  47. }
  48. }
  49. public CodeStatement InitStatement {
  50. get {
  51. return initStatement;
  52. }
  53. set {
  54. initStatement = value;
  55. }
  56. }
  57. public CodeStatementCollection Statements {
  58. get {
  59. if ( statements == null )
  60. statements = new CodeStatementCollection();
  61. return statements;
  62. }
  63. }
  64. public CodeExpression TestExpression {
  65. get {
  66. return testExpression;
  67. }
  68. set {
  69. testExpression = value;
  70. }
  71. }
  72. }
  73. }