CodeVariableDeclarationStatement.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // System.CodeDom CodeVariableDeclarationStatement 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 CodeVariableDeclarationStatement
  17. : CodeStatement
  18. {
  19. private CodeExpression initExpression;
  20. private CodeTypeReference type;
  21. private string name;
  22. //
  23. // Constructors
  24. //
  25. public CodeVariableDeclarationStatement ()
  26. {
  27. }
  28. public CodeVariableDeclarationStatement( CodeTypeReference type, string name )
  29. {
  30. this.type = type;
  31. this.name = name;
  32. }
  33. public CodeVariableDeclarationStatement( string type, string name )
  34. {
  35. this.type = new CodeTypeReference( type );
  36. this.name = name;
  37. }
  38. public CodeVariableDeclarationStatement( Type type, string name )
  39. {
  40. this.type = new CodeTypeReference( type );
  41. this.name = name;
  42. }
  43. public CodeVariableDeclarationStatement( CodeTypeReference type,
  44. string name,
  45. CodeExpression initExpression )
  46. {
  47. this.type = type;
  48. this.name = name;
  49. this.initExpression = initExpression;
  50. }
  51. public CodeVariableDeclarationStatement( string type,
  52. string name,
  53. CodeExpression initExpression )
  54. {
  55. this.type = new CodeTypeReference( type );
  56. this.name = name;
  57. this.initExpression = initExpression;
  58. }
  59. public CodeVariableDeclarationStatement( Type type,
  60. string name,
  61. CodeExpression initExpression )
  62. {
  63. this.type = new CodeTypeReference( type );
  64. this.name = name;
  65. this.initExpression = initExpression;
  66. }
  67. //
  68. // Properties
  69. //
  70. public CodeExpression InitExpression {
  71. get {
  72. return initExpression;
  73. }
  74. set {
  75. initExpression = value;
  76. }
  77. }
  78. public string Name {
  79. get {
  80. return name;
  81. }
  82. set {
  83. name = value;
  84. }
  85. }
  86. public CodeTypeReference Type {
  87. get {
  88. return type;
  89. }
  90. set {
  91. type = value;
  92. }
  93. }
  94. }
  95. }