Jon Jagger
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 16 Namespacesprevious at this levelnext at this level 16.1 Compilation units Paragraph 11 A compilation-unit defines the overall structure of a source file. 2 A compilation unit consists of zero or more using-directives followed by zero or more global-attributes followed by zero ormore namespace-member-declarations. compilation-unit : using-directivesopt global-attributesopt namespace-member-declarationsopt Paragraph 21 A C# program consists of one or more compilation units, each contained in a separate source file. 2 When a C# program is compiled, all of the compilation units are processed together. 3 Thus, compilation units can depend on each other, possibly in a circular fashion. Paragraph 31 The using-directives of a compilation unit affect the global-attributes and namespace-member-declarations of that compilation unit, but have no effect on other compilation units. Paragraph 41 The global-attributes (§24) of a compilation unit permit the specification of attributes for the target assembly. 2 Assemblies act as physical containers for types. Paragraph 51 The namespace-member-declarations of each compilation unit of a program contribute members to a single declaration space called the global namespace. [Example: For example: File A.cs:
class A {}  
File B.cs:
class B {}  
The two compilation units contribute to the single global namespace, in this case declaring two classes with the fully qualified names A and B. Because the two compilation units contribute to the same declaration space, it would have been an error if each contained a declaration of a member with the same name. end example]
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS