January 2011
Intermediate to advanced
1648 pages
70h 30m
English
In C#, the way to import namespaces is by means of the using directive. As a result, instead of having to use fully qualified type names, you can refer to types by a shorter name. Leveraging using directives simply affects the name resolution carried out by the compiler. At runtime, types are always referred to by fully qualified names, as you saw before in Figure 24.4.
Using directives are scoped to the immediately enclosing compilation unit (that is, code file) or the namespace declaration in which they’re contained. For example, given the following code, you can refer to types in the System namespace directly:

You can’t ...
Read now
Unlock full access