CodeCompileUnit.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // System.CodeDom CodeCompileUnit Class implementation
  3. //
  4. // Author:
  5. // Daniel Stodden ([email protected])
  6. // Marek Safar ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc.
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. using System.Runtime.InteropServices;
  31. using System.Collections.Specialized;
  32. namespace System.CodeDom
  33. {
  34. [Serializable]
  35. [ClassInterface(ClassInterfaceType.AutoDispatch)]
  36. [ComVisible(true)]
  37. public class CodeCompileUnit
  38. : CodeObject
  39. {
  40. private CodeAttributeDeclarationCollection assemblyCustomAttributes;
  41. private CodeNamespaceCollection namespaces;
  42. private StringCollection referencedAssemblies;
  43. //
  44. // Constructors
  45. //
  46. public CodeCompileUnit()
  47. {
  48. }
  49. //
  50. // Properties
  51. //
  52. public CodeAttributeDeclarationCollection AssemblyCustomAttributes {
  53. get {
  54. if ( assemblyCustomAttributes == null )
  55. assemblyCustomAttributes =
  56. new CodeAttributeDeclarationCollection();
  57. return assemblyCustomAttributes;
  58. }
  59. }
  60. public CodeNamespaceCollection Namespaces {
  61. get {
  62. if ( namespaces == null )
  63. namespaces = new CodeNamespaceCollection();
  64. return namespaces;
  65. }
  66. }
  67. public StringCollection ReferencedAssemblies {
  68. get {
  69. if ( referencedAssemblies == null )
  70. referencedAssemblies = new StringCollection();
  71. return referencedAssemblies;
  72. }
  73. }
  74. #if NET_2_0
  75. CodeDirectiveCollection startDirectives;
  76. CodeDirectiveCollection endDirectives;
  77. public CodeDirectiveCollection StartDirectives {
  78. get {
  79. if (startDirectives == null)
  80. startDirectives = new CodeDirectiveCollection ();
  81. return startDirectives;
  82. }
  83. }
  84. public CodeDirectiveCollection EndDirectives {
  85. get {
  86. if (endDirectives == null)
  87. endDirectives = new CodeDirectiveCollection ();
  88. return endDirectives;
  89. }
  90. }
  91. #endif
  92. }
  93. }