Visual Studio 2005 Extensibility


Visual Studio 2005 builds on an extensibility model that was first developed for Visual C++ 5. In Visual Studio 2005, the DTE object—DTE in this context stands for Development Tools Extensibility—sits at the top level of an automation model that features nearly 200 objects.

The functionality provided by the DTE object model can be described as user-defined customization. The DTE API is available to developers who are programming macros, wizards, and add-ins. Even more functionality is exposed to commercial-language developers who use the Visual Studio SDK to add custom languages and designer support to the IDE.

The following sections describe the automation mechanisms available to developers who are customizing Visual Studio 2005.

Macros

The macros facility in Visual Studio 2005 provides programmers with easy access to the features available through the automation APIs. The macros facility features its own Macro Explorer tool window (described earlier in the chapter), an extremely powerful macro recording facility, and a full-blown Macros IDE that is itself extensible through the DTE object model and that allows you to debug your macros. We'll use macros to illustrate concepts relating to extensibility throughout the book. Chapter 5 covers creating and editing macros in the Macros IDE in detail.

Macros in Visual Studio 2005 are written in Visual Basic. Because the macros facility takes advantage of the .NET Framework, macro programmers have access to the entire .NET Framework base class library as well as to functionality exposed by custom assemblies built in any other .NET language.

To open the Macros IDE, just press Alt+F11 from inside Visual Studio. The Macros IDE will open in a new window. The first thing you'll notice about the Macros IDE is that its layout is extremely similar to the layout of Visual Studio 2005. In fact, you'll find that most of the features available to you as a Visual Studio 2005 programmer are available to you as a macro programmer.

Figure 1-13 shows the Macros IDE in its default layout. This layout features a Project Explorer window that shows all of your currently loaded macro projects.

image from book
Figure 1-13: The Visual Studio 2005 Macros IDE

Add-Ins

Add-ins allow developers to create extensions to the Visual Studio IDE and to the Macros IDE. In general, compiled add-ins provide better performance than Visual Studio macros. Add-ins also provide functionality that integrates seamlessly into the environment. Independent software vendors (ISVs) and individual programmers can extend the IDE through add-ins in a way that makes the use of the add-in look just like a built-in part of the IDE.

Add-ins can be written in any .NET language, or they can be written as native COM components in unmanaged Visual C++. Add-ins are required to implement the IDTExtensibility2 interface. Most of the add-in samples in this book will be shown in Visual C#.

Microsoft makes available a number of add-in samples that you can use to explore the extensibility object model or simply to add functionality to your Visual Studio 2005 IDE. Samples and more information are available at http://msdn.microsoft.com/vstudio/extend/. We'll use a few of these add-ins in the early chapters of the book to add specific features to Visual Studio. In Chapter 6, we'll provide all the details you need to build your own custom add-ins.

Wizards

Visual Studio wizards are similar to add-ins, but they are created using the IDTWizard interface. Wizards are fairly simple constructions that are designed to take a user step by step through a specific task.

Wizards are used in Visual Studio for a variety of purposes. Project wizards help get you started on a particular type of Visual Studio project, as shown in Figure 1-14. Other wizards in the IDE walk you through adding code to an existing project.

image from book
Figure 1-14: The MFC ActiveX® Control Wizard provides a starting point for a project.

Starter Kits

Starter kits are a new type of project template that lets you take an existing project and then supply it to others as an installable package. In Chapter 4, we'll show you how to create your own starter kits so that you can share extendable projects with the developer community.

The Visual Studio SDK

The Visual Studio SDK provides hooks into the IDE that allow developers to add their own languages and designers to Visual Studio. Developers can use these hooks to integrate new .NET languages and high-end tools into the IDE. Because developing with the SDK is fairly complicated, we didn't think that we could do it justice in this edition of the book. You can find out more about it through the Visual Studio Developer Center at http://msdn.microsoft.com/vstudio.




Working with Microsoft Visual Studio 2005
Working with Microsoft Visual Studio 2005
ISBN: 0735623155
EAN: 2147483647
Year: 2006
Pages: 100

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net