What's New in Visual Studio .NET 1.1? Visual Studio .NET provides a new set of features designed to improve and enhance the development experience.Most of these changes have to do with user ergonomics and are typical of a minor release of a Visual Studio product. Only a few of the changes are related to the underlying platform. This article assumes you are familiar with Visual Studio .NET 1.0 and it presents only the new features of the IDE (Integrated Development Environment) of Visual Studio .NET 1.1, for both C# and Visual Basic .NET. J# is not discussed because it was not part of Visual Studio .NET 1.0. In the interest of space, some minor cosmetic changes (such as reorganization of the Start page) are not listed. IntelliSense Enhancements IntelliSense gets a boost with Visual Studio .NET 1.1, with many new features and capabilities. These features are clearly aimed at automating mundane programming tasks and have nothing to do with the new .NET 1.1 runtime. IntelliSense History Visual Studio .NET 1.1 keeps track of the most frequently used methods or properties of any type you interact with during code writing. When you type the dot (".") character to de-reference a type member, IntelliSense will suggest the member you are most likely to choose based on your history of using this type. If you start typing the member prefix, IntelliSense will refine its suggestion but still base it on history. For example, consider the Trace class, defined in the System.Diagnostics namespace. The Trace class is used to trace some information using the WriteLine() static method: Trace.WriteLine("I am here");
WriteLine() writes the content of the trace message to the Output window and appends a new line feed. The Trace class has a method called Write() that does not append the line feed, so you are far less likely to use it. In Visual Studio .NET 1.0, if you were to type "Trace.w" then IntelliSense would suggest Write() instead of WriteLine(), because it is first alphabetically. In Visual Studio .NET 1.1, if you use WriteLine() more frequently that you use Write(), then IntelliSense will suggest WriteLine() instead (see Figure 1).  Figure 1: History-based IntelliSense. In C#, IntelliSense will use both the prefix of the member and the history of the most frequently used members to suggest a type member.If you only type the dot, IntelliSense will suggest the most frequently used member of the type. IntelliSense history works both for Visual Basic .NET and for C#. However, C# developers can configure IntelliSense to use alphabetical order instead of most used history. You will see how to do just that later on in the section about the Tools options. Skeletal Interface Implementation As a developer, you will occasionally need to implement a class based on an interface defined by another party. Instead of copying and pasting the interface definition or typing it in, you can use Visual Studio .NET to generate a skeletal implementation of an interface in your class. A skeletal implementation is a do-nothing implementation of the interface: methods do not modify parameters and they return default values. A skeletal implementation is required to at least get the code compiled as a starting point when implementing an interface. To have Visual Studio .NET generate a skeletal interface implementation, first add the interface to the class derivation chain. When you finish typing the interface name (such as IFoo), IntelliSense will ask in a tool tip: "Press TAB to implement stubs for interface 'IFoo'." (see Figure 2).  Figure 2: When adding an interface to a type derivation list, you can press Tab to have IntelliSense implement a skeletal interface implementation.| " | IntelliSense will suggest the member you are most likely to choose, based on your history of using this type
| " |
If you press the Tab key, Visual Studio .NET will create a skeletal implementation of the interface on your class, and will scope it with a collapsible #region. For example, for this interface definition: public interface IFoo { void Method1(); bool Method2(string str); }
Visual Studio .NET will generate this skeletal implementation: public class MyClass : IFoo { #region Implementation of IFoo public void Method1() { }
public bool Method2(string str) { return true; } #endregion }
The skeleton returns a default value from methods that have a return value so that you can compile it. In Visual Basic .NET, when you add the Implements directive and supply the interface name, Visual Studio .NET will automatically add the skeletal interface implementation. For example, for this interface definition: Public Interface IFoo Sub Method1() Function Method2(ByVal str As String) As Boolean End Interface
Visual Studio .NET will generate this skeletal implementation: Public Class SomeClass Implements IFoo
Public Sub Method1() Implements IFoo.Method1
End Sub Public Function Method2(ByVal str As String) As Boolean Implements IFoo.Method2 End Function End Class
| & | | 
By: Juval Lowy Juval Löwy is a software architect and the principal of IDesign, a consulting and training company focused on .NET architecture consulting and advanced .NET training. This article contains excerpts from his latest book (Programming .NET Components 2nd Edition (O'Reilly, 2005). Juval is a frequent presenter at development conferences and Microsoft's Regional Director for the Silicon Valley.
Over the last three years Juval has been part of the Strategic Design Review process for .NET 2.0.
Microsoft recognized Juval as a Software Legend as one of the world's top .NET experts and industry leaders.
Contact him at www.idesign.net
| Fast Facts | | The changes and innovations from Visual Studio .NET 1.0 to Visual Studio .NET 1.1 are mostly improvement to the overall development experience and automating routine activities such as implementing an interface or events. Visual Studio .NET 1.1 also introduces new capabilities such as build events and specifying supported runtime versions. | |
|