A Glimpse at Microsoft Visual Studio 2010

Introduction

In this article I am going let you know the notable
features of Microsoft Visual Studio 2010 IDE
Professional Edition
which hit my eye at a first
glimpse. Currently only the beta versions of Visual Studio
2010 and .NET framework 4.0 are available, but the actual
release is expected sometime in the first quarter of this
year.

Not surprisingly it provides support for the .NET
framework 2.0, 3.0, 3.5 and 4.0. The target .NET framework
SDK can be chosen while creating the project initially.

Here’s where you can download the Beta version of Microsoft
Visual Studio 2010
.

Visual Changes

I opened the Microsoft Visual Studio 2010 IDE for the
first time and I was totally astonished by the look and feel
of the IDE, in fact it took me a little while to recognize
it to be Visual Studio. The style was totally changed from
its traditional colors and shapes.

To be frank the readability of the texts were so much
improved, similar to that of the WPF vector based line and
graphics. All the unwanted lines and gradients had been
removed. Even the infamous Visual Studio icon has been
changed too. The screen shot below provides enough
evidence.



Figure 1.0

Support for Microsoft F#

Visual F# is a new language introduced by Microsoft along
with .NET framework 4.0 and it is integrated very well for
doing the development in Visual Studio 2010. Visual F# is a
language which supports functional programming as well as
object oriented programming.

The .NET framework is packed with a tool named fsi.exe,
which is useful for running the F# commands instantly which
can be compiled and executed on the fly. To open the tool
open Visual Studio 2010 command prompt and type fsi and hit
enter.

Below is the sample F# program:


//First look at F#
// Learn more about F# at http://fsharp.net

//Importing required libraries
open System
open System.Windows.Forms

//instantiates a Form
let form = new Form();
form.Width <- 200;
form.Height <- 100;
form.Text <- “First F# Program”

let label = new Label()
label.Text <- “This is a Label”
form.Controls.Add(label)

#if COMPILED
[<STAThread>]
do Application.Run(form)
#endif



Fig 2.0 shows the output of the above F# program




Figure 2.0

Using Visual Studio 2010 provides F# projects to be
created, built, debugged and deployed. It also provides good
intellisence support for the language.

Currently there are only three kinds of projects
available in Visual F# (one is Silverlight Library project)
and a project for F# learning as shown in Fig 2.1



Figure 2.1

Integration of Sharepoint, Silverlight and projects for MS Office

Unlike the previous versions of Microsoft Visual Studio,
the 2010 version come with a tight integration of Sharepoint
project and tools for Office. It offers a wide range of
projects in both categories.

With the help of the Office project, visual studio easily
enables you to write macros and add ins using your favorite
language C#. Below is a sample Word 2007 project.


using System;
using Microsoft.Office.Tools.Word;
using Microsoft.VisualStudio.Tools.Applications.Runtime;
using Office = Microsoft.Office.Core;
using Word = Microsoft.Office.Interop.Word;

namespace WordDocument1
{
public partial class ThisDocument
{
private void ThisDocument_Startup(object sender, System.EventArgs e)
{
//Add code to perform tasks on document startup
}

private void ThisDocument_Shutdown(object sender, System.EventArgs e)
{
//Add code to perform tasks on document shutdown
}

#region VSTO Designer generated code

/// <summary>
/// Required method for Designer support – do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisDocument_Startup);
this.Shutdown += new System.EventHandler(ThisDocument_Shutdown);
}

#endregion
}
}


In the above code see that the Word interop assemblies
have been included in the class file automatically.

The XAML editor for Silverlight and Windows Presentation
Foundation applications has also been improved a lot like
drag dropping the data binding onto the WPF controls and in
terms of intellisence support.

Easy Zoom-In and Zoom-Out of Editor Text

The zoom in and zoom out feature of the code editor will
definitely be a surprising fact for the developers. You can
easily zoom-in or zoom-out by pressing the Ctrl key and
rotating the scroll up or down as you do with Internet
Explorer or other Microsoft Applications. If you are not
using the mouse, then you can make use of the percentage box
which displays at the left bottom corner of the code
editor.

Minimum zoom percentage is 20% and Maximum zoom
percentage is 400%. For people who are not comfortable with
the font sizes of the Visual Studio code editor this feature
is a real bliss.

Navigate To Feature

This is a new search functionality introduced in Visual
Studio 2010 which forms the latest member in the list of
Object Browser, Find Symbol and Find Results.

Follow either of the two ways to open the Navigate To window:


  1. You can open the “Navigate To” window by
    pressing the keys “Ctrl + , ” combination, note that the +
    also forms a part of the hot keys that is why I have
    enclosed them in double quotes.
  2. The other way would be to go to Edit and select
    “Navigate To”

The navigate to option will search and display the class,
class members and objects used in the solution and will
display the line number along with the file name with
path.

When you double click on the search results, it acts like
a “go to” definition and it take you to the definition of
that result which would be a part of the current
solution.

A major reason you would like this feature is that the
search is performed so fast and changes on search text
changed.

Search options available:

  1. You can enter the search text as all in lower case, so
    that it will perform a non-case sensitive search. If the
    search text contains any upper case letter, then the search
    becomes a case sensitive one.
  2. You can enter “Print s” which will search for code which
    has the words Print and s, the blank space is actually
    designated to act like an AND operator.
  3. You can also perform searches based on Pascal casing and
    underscored camel casing like “PMF” would search for a class
    or a member with name “PrintMessageFirst“.

Fig 5.0 shows a sample Navigate To window:




Fig 5.0

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read