CodeParameterDeclarationExpression.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // System.CodeDom CodeParameterDeclarationExpression Class implementation
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) 2001 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 CodeParameterDeclarationExpression
  16. : CodeExpression
  17. {
  18. private CodeAttributeDeclarationCollection customAttributes;
  19. private FieldDirection direction;
  20. private string name;
  21. private CodeTypeReference type;
  22. //
  23. // Constructors
  24. //
  25. public CodeParameterDeclarationExpression ()
  26. {
  27. }
  28. public CodeParameterDeclarationExpression( CodeTypeReference type, string name )
  29. {
  30. this.type = type;
  31. this.name = name;
  32. }
  33. public CodeParameterDeclarationExpression (string type, string name)
  34. {
  35. this.type = new CodeTypeReference( type );
  36. this.name = name;
  37. }
  38. public CodeParameterDeclarationExpression (Type type, string name)
  39. {
  40. this.type = new CodeTypeReference( type );
  41. this.name = name;
  42. }
  43. //
  44. // Properties
  45. //
  46. public CodeAttributeDeclarationCollection CustomAttributes {
  47. get {
  48. if ( customAttributes == null )
  49. customAttributes = new CodeAttributeDeclarationCollection();
  50. return customAttributes;
  51. }
  52. }
  53. public FieldDirection Direction {
  54. get {
  55. return direction;
  56. }
  57. set {
  58. direction = value;
  59. }
  60. }
  61. public string Name {
  62. get {
  63. return name;
  64. }
  65. set {
  66. name = value;
  67. }
  68. }
  69. public CodeTypeReference Type {
  70. get {
  71. return type;
  72. }
  73. set {
  74. type = value;
  75. }
  76. }
  77. }
  78. }