Namespaces being stupid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Justin

    #1

    Namespaces being stupid

    I've made some controls that have namespaces and I have trouble with
    the "using namespace" line, it doesn't do anything. Here's what's
    going on:

    1). I have a class like this:

    namespace N1.N2
    {
    class A{};
    }

    2). I reference the project with N1.N2 from another project's file
    where I want to use my class I have:

    using N1;
    using N1.N2;

    namespace N3
    {
    // Inside the code somewhere ...
    N2.A test = new N2.A(); // This line does not work
    N1.N2.A test = new N1.N2.A(); // This DOES work

    Why can't I make use of the "using namespace" line to shorten my code?
    I don't want to have to write out all the N1.N2.xxxx stuff, it's
    annoying and makes my code look messy. There are not naming conflicts
    with other namespaces.

    Help please!

    Thanks!
Working...