Macro Explorer


Macros are a series of consolidated commands that can be launched as one unit, typically through a key combination. As such, they are a huge productivity booster. You might use a macro, for instance, to automatically insert comments into your code, rearrange the windows within the IDE, or report on code statistics. Because macros can be wired into the extensibility object model, there are a host of functions accessible to you via macros.

The Macro Explorer, shown in Figure 5.16, is a tree-view window that exposes the list of macros within a solution.

Figure 5.16. The Macro Explorer.


The Macros Root Node

The Macros root node has shortcut menu items for loading existing macro projects, creating a new macro project, or launching the Macros IDE. The Macros IDE is covered in depth in Chapter 11, "Writing Macros, Add-ins, and Wizards." Underneath the Macros root node, child nodes are organized hierarchically in the following fashion: projects modules macros.

Projects

A macro project is a logical and physical container for macros that can span a variety of different functions and intents. The projects themselves are physically stored as a .vsmacros file. By default, macro projects reside within a separate VsMacros subdirectory within the Visual Studio projects directory.

At the projects level, you can

  • Rename a project

  • Create a new module within a project

  • Unload a project (for example, unload it from the Macro Explorer window)

  • Set the active "recording" project

If the Set as Recording Project option is selected, macros will be recorded into the selected project.

Modules

A module is a logical grouping of macros, typically used to store related macros. You might, for instance, create a module called FileUtilities to store macros designed to help with file management. With the module shortcut menu, you can

  • Create a new macro

  • Edit the module's macro code in the Macros IDE

  • Rename the module

  • Delete the module

Macro

The macro is analogous to a function. Right-clicking on the macro enables you to

  • Run the macro

  • Edit the macro within the Macros IDE

  • Rename the macro

  • Delete the macro




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