■
Note
C# also provides a mechanism that can be used to resolve name clashes between identically named
namespaces
using the namespace alias qualifier (
::
) and
global
token. Thankfully, this type of name collision is
rare. If you require more information regarding this topic, look up my article “Working with the C# 2.0 Command
Line Compiler” from
http://msdn.microsoft.com
.
Creating Nested Namespaces
When organizing your types, you are free to define namespaces within other namespaces. The .NET
base class libraries do so in numerous places to provide an even deeper level of type organization.
For example, the Collections namespace is nested within System, to yield System.Collections. If
you wish to create a root namespace that contains the existing My3DShapes namespace, you can
update your code as follows:
Do'stlaringiz bilan baham: |