Results 1 to 7 of 7

Thread: Namespaces...

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Namespaces...

    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...
    Code:
    Imports SomeLib.Joe
    Imports SomeOtherLib.Joe
    
    'blah, blah
    Dim x As [SomeLib.Joe.]SomeClass '...
    And I would just like to be able to do
    Code:
    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?

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I think , it's working like .net framework Classes .It can be shared across other libraries !

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Hmmm, I'll have to mess around with it some more then...

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes you can and the namespace for a project can be set in the project properties.

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width