Export (0) Print
Expand All

9.3 Using directives

Visual Studio .NET 2003

Using directives facilitate the use of namespaces and types defined in other namespaces. Using directives impact the name resolution process of namespace-or-type-names (Section 3.8) and simple-names (Section 7.5.2), but unlike declarations, using directives do not contribute new members to the underlying declaration spaces of the compilation units or namespaces within which they are used.

using-directives:
using-directive
using-directives   using-directive
using-directive:
using-alias-directive
using-namespace-directive

A using-alias-directive (Section 9.3.1) introduces an alias for a namespace or type.

A using-namespace-directive (Section 9.3.2) imports the type members of a namespace.

The scope of a using-directive extends over the namespace-member-declarations of its immediately containing compilation unit or namespace body. The scope of a using-directive specifically does not include its peer using-directives. Thus, peer using-directives do not affect each other, and the order in which they are written is insignificant.

Show:
© 2014 Microsoft