Tuesday, 10 September 2013

Namespace and class with the same name?

Namespace and class with the same name?

I'm organizing a library project and I have a central manager class named
Scenegraph and a whole bunch of other classes that live in the Scenegraph
namespace.
What Id really like is for the scenegraph to be MyLib.Scenegraph and the
other classes to be MyLib.Scenegraph.*, but it seems the only way to do
that woudl be to make all the other classes inner classes of Scenegraph in
the Scneegraph.cs file and thats just too unwieldly.
Instead, I've organized it as Mylib.Scenegraph.Scenegraph and
MyLib.Scenegraph.*, which sort of works but i find visual studio gets
confused under some conditions as to whetehr i am referring to the class
or the namespace.
Is there a good way to organize this package so its convenient for users
without glomming all my code together in an unmaintainable mess?
Thanks.

No comments:

Post a Comment