PDA

Click to See Complete Forum and Search --> : Namespaces...


crptcblade
Feb 11th, 2003, 09:17 PM
Is it possible to share a namespace across multiple libraries? For instance, I have used namespace Joe in one class library, and I would like the classes in that library to show up in the same list as the classes in another library that also defines the namespace Joe.

Right now, I have this...

Imports SomeLib.Joe
Imports SomeOtherLib.Joe

'blah, blah
Dim x As [SomeLib.Joe.]SomeClass '...


And I would just like to be able to do

Imports Joe


And have access to SomeLib's classes, and SomeOtherLib's classes.

The same way System works. There is a separate System.IO component, System.XML, System.Text, etc, and yet they all show up under the common System namespace. See what I mean?

:)

Pirate
Feb 11th, 2003, 09:35 PM
I think , it's working like .net framework Classes .It can be shared across other libraries !

crptcblade
Feb 11th, 2003, 09:36 PM
Hmmm, I'll have to mess around with it some more then...

:)

Edneeis
Feb 11th, 2003, 11:10 PM
Yes you can and the namespace for a project can be set in the project properties.

Cander
Feb 12th, 2003, 09:26 AM
Well going by your example. the answer is no

if your setup is:
SomeLib.Joe
SomeOtherLib.Joe

you cant just import Joe.

If it is reversed
Joe.SomeLib
Joe.SomeOtherLib

then you can

Cander
Feb 12th, 2003, 09:26 AM
Well going by your example. the answer is no

if your setup is:
SomeLib.Joe
SomeOtherLib.Joe

you cant just import Joe.

If it is reversed
Joe.SomeLib
Joe.SomeOtherLib

then you can

crptcblade
Feb 12th, 2003, 12:29 PM
Originally posted by Cander
Well going by your example. the answer is no

if your setup is:
SomeLib.Joe
SomeOtherLib.Joe

you cant just import Joe.

If it is reversed
Joe.SomeLib
Joe.SomeOtherLib

then you can

Yeah, I saw Ed's post about setting the root namespace, and I think that should do it.

:)