Name Question

  • Thread starter Thread starter Wole Ogunremi
  • Start date Start date
W

Wole Ogunremi

I asked this in the .dotnet.general group but got no replies...

If a namespace contains another namespace, and a class with the same names
how can one differentiate them?
Eg

Namespace foo
Class doSomething
........
End Class
Class classOne
........
End Class
Class classTwo
........
End Class
Namespace doSomething
Class anotherClass
...
End Class
Class anotherClassTwo
...
End Class
End Namespace
End Namespace

If one wanted to import foo.doSomething visualstudio automatically loads the
class instead of the namespace.
How would one go about directing it to import the namespace instead of the
class?

ps: I am working with packages that I have no control over.

Thanks
Wole
 
Wole Ogunremi said:
If a namespace contains another namespace, and a class with the same names
how can one differentiate them?
Eg

Namespace foo
Class doSomething
........
End Class
Class classOne
........
End Class
Class classTwo
........
End Class
Namespace doSomething
Class anotherClass
...
End Class
Class anotherClassTwo
...
End Class
End Namespace
End Namespace

If one wanted to import foo.doSomething visualstudio automatically loads
the
class instead of the namespace.
How would one go about directing it to import the namespace instead of the
class?

ps: I am working with packages that I have no control over.

What language was used to develop the package? VB.NET and C# don't compile
the code you showed above because of the name clash. I wonder if any other
..NET programming language allows that. I would strongly recommend to make
the author of the class library aware of this problem.
 
Herfried,

I'm trying to work with SAXON.NET which is java ported to IL and works great
with C#!
They've got a Query class within the net.sf.saxon namespace which also holds
a query namespace...
Of course being that C# is case sensitive the two can co-habit. I just
wondered how I might consume it in VB.NET....

Thanks for you reply.

Wole
 
Wole Ogunremi said:
I'm trying to work with SAXON.NET which is java ported to IL and works
great with C#!
They've got a Query class within the net.sf.saxon namespace which also
holds a query namespace...
Of course being that C# is case sensitive the two can co-habit. I just
wondered how I might consume it in VB.NET....

Isn't it possible to fully qualify the class name with its namespace if you
want to use the class in your code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top