CodeNamespace.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // System.CodeDom CodeNamespace 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 CodeNamespace
  17. : CodeObject
  18. {
  19. private CodeCommentStatementCollection comments;
  20. private CodeNamespaceImportCollection imports;
  21. private CodeTypeDeclarationCollection types;
  22. private string name;
  23. //
  24. // Constructors
  25. //
  26. public CodeNamespace()
  27. {
  28. }
  29. public CodeNamespace(string name)
  30. {
  31. this.name = name;
  32. }
  33. //
  34. // Properties
  35. //
  36. public CodeCommentStatementCollection Comments {
  37. get {
  38. if ( comments == null ) {
  39. comments = new CodeCommentStatementCollection();
  40. PopulateComments( this, EventArgs.Empty );
  41. }
  42. return comments;
  43. }
  44. }
  45. public CodeNamespaceImportCollection Imports {
  46. get {
  47. if ( imports == null ) {
  48. imports = new CodeNamespaceImportCollection();
  49. PopulateImports( this, EventArgs.Empty );
  50. }
  51. return imports;
  52. }
  53. }
  54. public string Name {
  55. get {
  56. return name;
  57. }
  58. set {
  59. name = value;
  60. }
  61. }
  62. public CodeTypeDeclarationCollection Types {
  63. get {
  64. if ( types == null ) {
  65. types = new CodeTypeDeclarationCollection();
  66. PopulateTypes( this, EventArgs.Empty );
  67. }
  68. return types;
  69. }
  70. }
  71. //
  72. // Events
  73. //
  74. public event EventHandler PopulateComments;
  75. public event EventHandler PopulateImports;
  76. public event EventHandler PopulateTypes;
  77. }
  78. }