Oct 23 2006

Code Snippets in Visual Studion 2005

Category:Bil@l @ 18:28

I found out that 3 different ways are used to add a Code Snippet in your code:

  1. Right Click --> Insert Snippet --> then select a snippet.
  2. Ctrl button + k + x --> this combination will allow you to select a Code Snippet
  3. Using the Tab button. If you know the name of the Snippet, simply type it, then press Tab twice. For example, "if" if a built-in snippet for you, type if then hit Tab twice, you will see the snippet inserted.

Hope this helps you!

Regards

Tags:

Oct 23 2006

AutoRecovery feature in Visual Studio 2005

Category:Bil@l @ 18:15

I was working on Visual Studio 2005 lately and noticed a new feature which is AutoRecorvery.

You can define a certain time span to allow VS to autosave your work in case an electricity failure or any other failure happens, just like MS Word does!

To reach this option, Tools --> Options --> Environment --> AutoRecover.

Hope this tip helps you!

Regards

Tags:

Oct 23 2006

Optional Parameters in C#

Category:Bil@l @ 18:05

I have always heard that Optional parameters are not explicitly available in C#. Lately, I was reading the: Microsoft Visual C# Core Reference, while reading the section about Params keyword in C#, I got an idea that we can implement Optional Parameters in C# using the Params keyword.

Just to be on the safe side and you all know what Params means, it allows you to send to a method an array of unspecified number of arguments.

So make sure when you want to use the Params keyword to have it as the last item in the method parameters, because any parameter after it, will be collected as an array in the method body.