Home All Groups Group Topic Archive Search About

Question about Namespaces and the Object Browser.

Author
15 Apr 2005 3:15 PM
cr113
I can't seem to make sense out of the Object Browser in VB.NET.

Here's one example. I often use the the Sleep method found in the
Thread object like this:

Imports System.Threading

Private Sub test
    Thread.Sleep(1000)
End test

When I look in the Object Browser under System I find System.Threading.
Nowhere do I find the Thread object. Where is it? I can't find it
anywhere in the Object Browser.

Another question. The top level of the Object Browser looks something
like this:

System
System.Data
System.Drawing

Why wouldn't Data be found UNDER the System namespace instead of
BESIDES it?

Also when you look at the System namespace you find something like
this:

System
     Microsoft
     Microsoft.CSharp
     System
     System.Threading

Shouldn't my Import statement be this:

Imports System.System.Threading?

Is the Object Browser hierarchical or just random?

I'm so confused!!!!!

Author
15 Apr 2005 3:33 PM
Herfried K. Wagner [MVP]
<cr***@hotmail.com> schrieb:
Show quoteHide quote
>I can't seem to make sense out of the Object Browser in VB.NET.
>
> Here's one example. I often use the the Sleep method found in the
> Thread object like this:
>
> Imports System.Threading
>
> Private Sub test
>    Thread.Sleep(1000)
> End test
>
> When I look in the Object Browser under System I find System.Threading.
> Nowhere do I find the Thread object. Where is it? I can't find it
> anywhere in the Object Browser.
>
> Another question. The top level of the Object Browser looks something
> like this:
>
> System
> System.Data
> System.Drawing
>
> Why wouldn't Data be found UNDER the System namespace instead of
> BESIDES it?
>
> Also when you look at the System namespace you find something like
> this:
>
> System
>     Microsoft
>     Microsoft.CSharp
>     System
>     System.Threading
>
> Shouldn't my Import statement be this:
>
> Imports System.System.Threading?
>
> Is the Object Browser hierarchical or just random?

The names in the first row are assembly names, not namespace names.  Notice
that namespaces are not necessarily available in a single assembly,
different types residing in different assemblies can be part of the same
namespace.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
15 Apr 2005 3:47 PM
Oenone
cr***@hotmail.com wrote:
> When I look in the Object Browser under System I find
> System.Threading. Nowhere do I find the Thread object. Where is it? I
> can't find it anywhere in the Object Browser.

If you press Ctrl+Shift+Alt+F12 (phew!), it will open the 'Find Symbol'
window. In here, type 'Thread' in the 'Find What' box and then click 'Find'.

All the matching symbols will appear in the panel at the bottom. If you
scroll down you'll see 'Thread (System.Threading)' in the list. Double-click
it and it'll take you to the class within the object browser. (It's actually
under mscorlib/Namespaces/System.Threading/Classes).

Hope that helps,

--

(O)enone