Tuesday, March 3, 2009

Visual C# IDE Tips: Part II

Posted on/at 6:38 AM by Admin


This post explains the some more tips on using Visual C# IDE to enhance developer productivity.

  • Solution Configurater Right click your solution in your IDE then select the Configuration Manager you see the following window
    clip_image001
    Where you have the option to select the project for building. We can select the required project in the solution and can you can build the project.
  • Solution Wide Comments You can add task lists and comments to your solution. To view the task list for your solution select view menu and click on TaskList option. Ctrl + W, T you will see the following window
    clip_image002
    You can add the task list items to window by writing the following snippet in the code file.
    //TODO Write some code
    Which really helps the developer to set reminders to write the code and also useful to suggest the developers to refactor the code by setting the TaskList comments.
  • Snippet Designer Download the Snippet Designer
    The above snippet designer is a plug-in which integrated in to the visual studio IDE which adds a rich and productive experience to the developer.
    It allows the developer to write a snippet in the IDE as follows
    clip_image003
    To insert a snippet for example to write class type class and double tab it inserts class template.
    clip_image004
    code snippets are really great way to build the code.
    Ctrl + K, X is the short cut for insert snippet. You can use Shift + Tab to navigate the categories in the snippet.
  • Background Squiggles When you type some code in IDE and if the code having any errors it immediately shows an red mark under the identifier which you have written in the code.
    for example:
    clip_image005
    It shows the above tool tip if the required namespace declaration miss in your code file. No need to write the namespace at the top just press the
    Ctrl + . smart tag appears as follows

    clip_image006
    It automatically inserts the using statement in the using declarations section.
    If the method is not defined in your code it generates the method for you
    clip_image007
  • Expand/Shrink Selection To select the statement in your code you can use CTRL + ALT, = which allows you to select the logical blocks in your code and CTRL + ALT, – to unselect the block of code.
  • Organizing Using's You may want to sort the using statements in your code file or you may want to remove the unused using statements. you can do as follows in the IDE
    clip_image008
  • Camel Case Navigation we all know that we can use arrow keys to move around the code in our file and we can hold the Ctrl key to move around the words and we can use Ctrl + Shift to select the words. Coderush comes with new shortcut Alt+Left and Alt+Right to move around the camel cases in code.
  • Anonymous Type In order to expose anonymous code in public APIs we need to write some type casts. coderush comes with nameanonymous type it creates a new class.
    clip_image009
  • Extract Method you can select the code and click on extract method in smart window and shows the preview as shown in the window
    clip_image010

Here I am summarizing what we have learnt in this post
clip_image011

 

Source: http://www.c-sharpcorner.com/UploadFile/kalisk/csharptips11112008172019PM/csharptips.aspx

0 comments:

Post a Comment

About Me

Developers house is a blog for posting technical articles in different technology like Microsft, Java, Oracle ..etc Microsoft technology includes c#,VB.net,ASP.net,Ajax,SilverLight,TFS,VS.NET 2003,2005,2008,2010 , SQL Server 2000, 2005 , Expression Blend , ...etc I hope it is helpful for all of you and if you are interested to post articles on it, only send me at ahmad.eed@gmail.com