Chapter 11. Writing Macros, Add-ins, and Wizards


IN THIS CHAPTER

  • Writing Macros

  • Writing Visual Studio Add-ins

  • Creating a Visual Studio Wizard

In the preceding chapter, we examined the API available for developers to customize, tweak, and control various portions of the Visual Studio IDE. This chapter will take that knowledge and show you how to write macros and add-ins that leverage the automation object model.

A macro's purpose is to provide you with an approach for writing your own task automation applets. In previous chapters, you saw many IDE features that automate repetitive tasks. The built-in refactoring support, IntelliSense word completion, code snippets, and others certainly fall into that category. And as you develop solutions with Visual Studio, you will find yourself performing additional repetitive tasks that beg for a solution. Macros are the means to that end.

Macros can be hand-crafted or generated for you by recording certain actions within the IDE. In fact, Visual Studio even has a separate macro development environmentthe Macros IDEdesigned to help you quickly develop macro solutions.

If macros represent the quick and easy approach to automation, then add-ins are their more complex, and more powerful, counterparts. Add-ins are compiled projects written in Visual Basic, Visual C#, Visual J#, or even Visual C++. Add-ins are useful for covering more advanced extensibility scenarios up to and including surfacing your own custom forms, tool windows, and designers in the IDE.

Another topic we'll tackle in this chapter is that of creating and customizing Visual Studio wizards. Wizards are launched any time you create a new project or add an item to a project. These wizards typically present one or more dialog boxes to capture preferences from the user and then use those preferences to create a project structure, generate default code, or perform even more complicated tasks. Wizards work in conjunction with template files to drive the initial structure for a code file or entire project. The entire framework for wizards and templates is available to customize to fit your particular needs.




Microsoft Visual Studio 2005 Unleashed
Microsoft Visual Studio 2005 Unleashed
ISBN: 0672328194
EAN: 2147483647
Year: 2006
Pages: 195

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