Visual Studio Shortcuts (Moving from Eclipse)

I am new to Visual Studio and .net infrastructure and I need help.

At first with VS, I cannot find the useful shortcuts that I used for Eclipse, for example:

  • Import packages (Ctrl + Shift + O in Eclipse).
  • Automatically generates some methods (for example, equals () and toString ()).
  • Automatically create the required try / catch with the correct Exception throw (no need to write it and look in MSDN for the correct exception).

Secondly, is there any Java-Api-Like documentation for the .NET framework, the MSDN is really confusing, and it is very difficult for me to find what I'm looking for.

+4
source share
3 answers

Hotkeys via MSDN.

I often use the most often:

  • CTRL + SHIFT + F12 (File Search)
  • SHIFT + F9 (Quick View)
  • F10 (step by step)
  • F11 (step by step)
  • F5 (Play)

Regarding the documentation, I actually find MSDN a great resource. Sometimes actually finding what I am looking for is the hardest part, but google solves this quite easily. The spelling, however, is usually clear and thorough, at least in my experience. If you have not seen them, they may be useful, especially the 2nd link.

MSDN-.NET Framework 4

MSDN - .NET Framework Class Library

I know that you said you didnโ€™t love him, but thatโ€™s really the best that seems to me.

+2
source

I am not familiar with Eclipse, but I will try to answer anyway ...

  • Import packages (Ctrl + Shift + O in Eclipse).

There is no concept of a package in .NET. There are assemblies that contain classes, and these classes are organized in namespaces. To add a link to the assembly, right-click on the project and select "Add Link". If you want to automatically import the namespace that contains the class you are using, place the cursor on the class name and type Ctrl + . . He will suggest to import a namespace.

  • Automatically create some methods (e.g. equals () et toString ()).

Just enter override and hit Space , it will offer a list of methods to override (including Equals and ToString )

  • Generate the necessary try / catch automatically with the correct exception thrown (no need to write it and look in MSDN for the correct exception)

Type try and press Tab , it will populate the try / catch block (this is called a code snippet ). There is no way to automatically catch the correct exception, because, unlike Java, C # methods do not declare which exceptions they can throw.

Secondly, is there any Java-Api-Like documentation for the .NET framework, the MSDN is really confusing, and it is very difficult for me to find what I'm looking for.

You can find the link for all .NET Framework classes here (here is the Object class ). IMHO is much more convenient than Java API documentation, but I think itโ€™s a matter of taste and habit ... You can also download standalone documentation that provides an index of classes, members, keywords, etc.

+6
source

The equivalent of Ctrl+Shift+O in Eclipse is Shift+Alt+F10 . To generate a try-catch, select the text with the mouse or shift and the arrow, and then ctrl+k , then ctrl+s . A window will appear in which you can see what your code block surrounds, for example, if , try , etc.

+1
source

Source: https://habr.com/ru/post/1397197/


All Articles