.Net framework is a jungle

dragon4spy

Centurion
Joined
Dec 22, 2003
Messages
110
Do you think that it is like a jungle or not? I always lost the ways to find the correct class.

What is it with System namespace in mscorlib assembly and System namespace in System assembly? How come there are 2 namespaces that have the same name existed by default? And it seems that some other namespaces (only name) are duplicated too.

How to recognize classes that require "New" statement with "Dim"? And how to recognize what classes that don't require "New"?

:confused: :D
 
There are no two namespaces with the name System. The classes and such from both assemblies were simply included in the System namespace. For example you could create a DLL that would have all its classes in the Windows.Forms namespace.

To use shared methods, properties etc. of the class you don't need to use the New keyword.
 
How to recognize classes that require "New" statement with "Dim"? And how to recognize what classes that don't require "New"?
To be safe, you can just declare all of your variables and then initialize them to be New.
Dim R As Anything = New Anything.
But, usually a Class and a Delegate are the only things that need to be initialized with New... I think.

In the picture I circled the class... a delegate has a purple box in front of a gray suitcase. Those are what you have to initialize with New. :)
 
:D Ok thanks. I have another question. Is there a way to distinguish between a class that takes parameter and a class doesn't? I mean by looking at Object Browser. :rolleyes:

Example for the class that takes parameter.
Dim s As DirectoryInfo = New DirectoryInfo("c:\test\")
 
In the Object Browser, the parameters for the New event (constructor) will be listed...
You do have to click on the name of the class that you are looking at. :)
 
MS has always had posters for all kinds of object models. I must have a whole box of them by now...
 
VolteFace said:
MS has always had posters for all kinds of object models. I must have a whole box of them by now...

my VB.Net came with nothing. It's like they laughed at me and said "Its discounted, what do you expext?"

Then I got VS.Net and got 7 cds, books and posters... damn, after I opened the box, I couldn't get it all back in :)
 
Back
Top