Monday, February 18, 2008

Shortcut to create Property out of Field - C#

To create Property out of Field, you need to declare a field as private and create Property for the field. But now you can create Property out of Field with combination of three keys. Yeah..., its Ctrl+R+E.
Declare the field as private and press "Ctrl+R+E" on the field name. It will popup a dialog where you can set the name of property (its almost what you want). Click OK to create Property in your C# code.

Property gets created automatically on click of OK

Sunday, February 17, 2008

Shortcut to implement methods and properties of Interface in inheriting class - C#

Whenever you create an Interface and implement in a class, you need to remember and override all methods or need to verify whether all methods/properties are impmenented. Using shortcut below you can implement all methods and properties of an Interface in inheriting class with click to three keys... i.e. "Alt+Shift+F10".

In the example below, I have created Interface with two methods and one property. While inheriting this interface in a class named "Test", you need to press "Alt+Shift+F10" on interface to implement all the methods and properties.

Press "Alt+Shift+F10" and press enter to implement all methods and properties.

Shortcut to add Namespace automatically while coding in class file - C#

While coding a class file, you might encounter situations where you come to know that namespace is missing and you need move to top of file and add a namespace by "using" keyword.

e.g. you are writing a DAL (Data Access Layer) and have to create a variable of "SqlDataReader". Suddenly you recognize that "System.Data.SqlClient" is missing (its a pain sometimes..). In this case you need to move top and type there.

Below is the shortcut for this problem. Taking above example, type SqlDataReader and press "Alt+Shift+F10" and press enter to create a namespace automatically.

Press "Alt+Shift+F10" to show Smart Tag and press enter to select first option.

You see, "System.Data.Sqlclient" got added without going and typing it...

Let me know your comments..

Shortcut to load MS Visual Studio faster

There is a way to load MS Visual Studio 2005 or 2008 IDE faster than ever to save your time. There is always some time involved in loading IDE but using the command below you can load IDE faster.

Type the command in your Run dialog:
devenv /nosplash

Happy Coding!!!

HEROES happen {here} registration open for Bangalore, Mumbai and Delhi

Registration for "HEROES happen {here}" event is open for Bangalore, Mumbai and New Delhi. Microsoft is celebrating the launch of Windows Server 2008, Visual Studio 2008 and SQL Server 2008. The event will bring together IT Pro's and Developers in your city to get an in-depth, up-close look at the new products and will give attendees an opportunity to meet with Microsoft employees and Partners who have been working on these new products.

Hurry and resigter yourself from link below:


Bangalore - 4-March-2008

Mumbai - 5-March-2008

Delhi - 6-March-2008

Hurry and reserve fast, as there are limited seats and get your FREE GIFT!!