Click here to Skip to main content
15,890,882 members
Articles / Programming Languages / C#

Visual Studio 2010 RC – Cool New Features

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
1 Mar 2010CPOL3 min read 10.1K   1  
I have been using Visual Studio 2010 Release Candidate and there are few cool things that I am pleasantly surprised about. I have list a few off the top of my head.

I have been using Visual Studio 2010 Release Candidate and there are a few cool things that I am pleasantly surprised about. I have a few off the top of my head. See my list below – with pictures.

Sequence Diagram Generation

I find this to be a life saver. I don’t know about you but as a developer I want to dive right into code after I finish designing. There are times I have to sequence diagrams and this usually comes before you start coding. Now, with the sequence diagram generator in Visual Studio 2010, I can write code then simply generate. This not only saves you time but also lets you better understand your branches in your code that can lead to code complexity or cyclomatic complexity

Here is the code that we will work with in this post.

C#
class Animal {
       public virtual void Description() { Console.WriteLine("Lives on earth"); }
    }

    class Bird : Animal {
        public override void Description() 
	{ Console.WriteLine("have feathers and a beak"); }
    }

    class Lion : Animal {
        public override void Description()
        {
            Console.WriteLine("roars and have large teeth");
        }
    }

    class Park
    {
        static void Main(string[] args)
        {
            List<Animal> animalsInPark = new List<Animal>();
            ShowDescriptions(animalsInPark);
        }

        static void ShowDescriptions(List<Animal> animals)
        {
            animals.ForEach(animal => animal.Description());
        }
    }

Now right click on ShowDescriptions() and click generate sequence diagram. You should see this dialog.

And voila – your very own Visual Studio 2010 crafted sequence diagram. I have to admit, I am really starting to like these diagrams.

Code Window Zoom

Visual Studio 2010 allows you to zoom in and out just as in Internet Explorer. All you have to do is press Ctrl and use your mouse wheel or your equivalent mouse pad scroll to zoom in and out. This may not be so exciting but when it comes to giving presentations, this will make all our lives easier when it comes to changing font size. The beauty about zooming is that the font is crisp and smooth due to the fact that Visual Studio 2010 is built with WPF. Below is an image of me zooming in on the Animal class.

Code Generation

Most of us who use Visual Studio 2008 love the generate method feature. If you don’t know what this is, here is your introduction. If you  write a method name and it doesn’t exists, you can right click on the method and tell Visual Studio to generate the stub and it will do it. No questions asked.

Visual Studio 2010 has taken this further and now you can even do classes. See below for demonstration.

Highlighted Reference

If you select a reference or even click on it, Visual Studio 2010 highlights all of the places it is used in your code.

Navigate To

Pressing Ctrl comma (,) brings up a dialog window that allows you to look for methods, properties, classes, etc. within your solution. It is case insensitive and it searches via partial name.

Clicking on any of the items found will take you to the line within the file where it is located.

Box Selection

This is one feature that I still have not found a suitable use for. This feature allows you to hold Ctrl + Alt and use either your mouse or arrow keys to select a rectangular area. If you now start typing, you will simultaneously be typing on all lines that you selected. If you happen to find a useful case for it, please let me know.

One thing I forgot to mention is that adding references to a project also seems faster. These are only some of the new features in Visual Studio 2010. Hope you find them as exciting as I do. Now go code!


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) 4CoreDev
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --