CodeIfStatement.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // System.CodeDom CodeIfStatement Class implementation
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) 2001 Ximian, Inc.
  8. //
  9. namespace System.CodeDom {
  10. public class CodeIfStatement : CodeStatement {
  11. CodeExpression condition;
  12. CodeStatementCollection trueStatements;
  13. CodeStatementCollection falseStatements;
  14. //
  15. // Constructors
  16. //
  17. public CodeIfStatement ()
  18. {
  19. trueStatements = new CodeStatementCollection ();
  20. falseStatements = new CodeStatementCollection ();
  21. }
  22. public CodeIfStatement (CodeExpression condition, CodeStatement [] trueStatements)
  23. {
  24. this.condition = condition;
  25. this.trueStatements = new CodeStatementCollection ();
  26. this.trueStatements.AddRange (trueStatements);
  27. this.falseStatements = new CodeStatementCollection ();
  28. }
  29. public CodeIfStatement (CodeExpression condition,
  30. CodeStatement [] trueStatements,
  31. CodeStatement [] falseStatements)
  32. {
  33. this.condition = condition;
  34. this.trueStatements = new CodeStatementCollection ();
  35. this.trueStatements.AddRange (trueStatements);
  36. this.falseStatements = new CodeStatementCollection ();
  37. this.falseStatements.AddRange (falseStatements);
  38. }
  39. //
  40. // Properties
  41. //
  42. public CodeExpression Condition {
  43. get {
  44. return condition;
  45. }
  46. set {
  47. condition = value;
  48. }
  49. }
  50. public CodeStatementCollection FalseStatements {
  51. get {
  52. return falseStatements;
  53. }
  54. }
  55. public CodeStatementCollection TrueStatements {
  56. get {
  57. return trueStatements;
  58. }
  59. }
  60. }
  61. }