开发者

display classes of a namespace in visual studio (C#)

I am a Java programmer, and just starting to use Visual Studio to do C# programming. In Java IDE such as Eclipse, if I do n开发者_运维知识库ot know the class name in a package, I can just type a dot (.) after a package name, then I will get a list of all the classes in that package. How I can configure visual studio to do the similar thing, say, if I click a namespace name in a file (for example, using System), or add a dot after the namespace, all the classes in that namespace will be displayed somewhere?


As far as I remember, the same scenario works. Type System. and Visual Studio should show the Intellisense window with its contents. If it doesn't show up you can try Ctrl+Space to force it appear.

If it still doesn't show anything, you might need to add an assembly reference to the DLL that contains that namespace to your project.

Obviously, if the namespace is System you don't need to add any reference, as it is added by default already.

Also relevant: the Object Browser view in Visual Studio.


If you want to know, first make sure Ctrl + SPACE is not used by other things such as IME. Then execute this shortcut for IntelliSense within the editor. Visual Studio will display all classes you can access in the context. It may not work like Java, but most people like me find it enough to move on.

To better understand each namespace, I am more used to hit F1 on the namespace to launch MSDN.


The Visual Studio intelligence is good enough to that for u only you have the correct reference added to your assembly. Or you can try Ctrl+Space to force it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜