Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcuts of Visual Studio (moving From Eclipse) [closed]

I am pretty new to Visual Studio and .net framework and I need some help.

First with VS I can't find the useful shortcuts I used to use with Eclipse such as :

  • Importing packages (Ctrl+Shift+O in Eclipse) .
  • Generating automaticly some methods (like equals() and toString()).
  • Generating the needed try/catch automatically with the right thrown Exception (no need to write it and search in MSDN for the right exception).

Second, is there any Java-Api-Like documentation for .net framework, MSDN is really confusing and I find it really hard to find what I look for.

like image 439
lemoos Avatar asked Jan 18 '23 11:01

lemoos


2 Answers

I'm not familiar with Eclipse, but I'll try to answer anyway...

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

There is no notion of "package" in .NET. There are assemblies that contain classes, and these classes are organized in namespaces. To add an assembly reference, right click on the project and select "Add reference". If you want to automatically import the namespace that contains a class you're using, put the caret on the class name and type Ctrl + .. It will suggest the namespace to import.

  • Generating automaticly some methods ( like equals() et toString()).

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

  • Generating the needed try/catch automaticly with the right thrown Exception (no need to write it and search in MSDN for the right exception)

Type try and hit Tab, it will complete the try/catch block (this is known as a code snippet). There is no way to automatically catch the right exception, because unlike Java, C# methods don't declare what exceptions they can throw.

Second ,is there any Java-Api-Like documentation for .net framework , MSDN is really confusing and I find it really hard to find what I look for.

You can find the reference for all .NET Framework classes here (here's the Object class for instance). IMHO it's much more convenient than the Java API documentation, but I guess it's a matter of taste and habit... You can also download the offline documentation, which provides an index of classes, members, keywords, etc.

like image 101
Thomas Levesque Avatar answered Jan 28 '23 07:01

Thomas Levesque


Keyboard shortcuts, via MSDN.

The ones I find myself using the most often are:

  • CTRL+SHIFT+F12 (Find in files)
  • SHIFT+F9 (Quick Watch)
  • F10 (Step Over)
  • F11 (Step Into)
  • F5 (Play)

As far as documentation goes, I actually find MSDN to be a great resource. Sometimes actually finding what I'm looking for is the hardest part, but google solves that pretty easily. The writing, however, is typically clear and thorough, at least in my experience. If you haven't seen these, perhaps they will be of some use, particularly the 2nd link.

MSDN - .NET Framework 4

MSDN - .NET Framework Class Library

I know you said you don't love it, but it truly is the best available in my opinion.

like image 33
Jeremy Wiggins Avatar answered Jan 28 '23 09:01

Jeremy Wiggins