18.9. PowerToys for the Class Designer

While the Class Designer is a very useful tool for designing and visualizing a class hierarchy, it can be cumbersome when trying to work with very large diagrams. To ease this burden you can either break up the diagram into multiple class diagrams, or install PowerToys for the Class Designer.

PowerToys for the Class Designer is a free add-in to Visual Studio that extends the functionality of the Class Designer in several ways. It includes enhancements that enable you to work more effectively with large diagrams including panning and zooming, improved scrolling, and diagram search. It also provides functions that address some of the limitations of the Class Designer such as the ability to create nested types and new derived classes and display XML comments.

The add-in, including source code, is available from http://www.codeplex.com/modeling. The download includes an MSI file for easy installation.

PowerToys actually consists of two add-ins: Design Tools Enhancements and Class Designer Enhancements. The Design Tools Enhancements provide common features for both the Class Designer and the Distributed System Designer, which is only available in Visual Studio Team System.

18.9.1. Visualization Enhancements

PowerToys for the Class Designer provides some very useful enhancements for visualizing and working with large class diagrams. The diagram search feature is one of the more useful; it allows you to search the entities on a diagram for a specific search term. The search dialog, shown in Figure 18-10, is invoked via the standard Find menu item or Ctrl+F shortcut.

Figure 18.10. Figure 18-10

Another useful tool for large diagrams is the panning tool, which provides an easy way to see an overview of the entire diagram and navigate to different areas, without changing the zoom level. This tool is invoked by clicking a new icon that appears in the bottom right of the window, which will display the panning window, as shown in Figure 18-11.

Figure 18.11. Figure 18-11

PowerToys also allows quite fine control over what is displayed on the diagram via the filtering options. These are available via the Class Diagram menu, and include:

  • Hide Inheritance Lines: Hides all inheritance lines in selection

  • Show All Inheritance Lines: Shows all hidden inheritance lines on the diagram

  • Show All Public Associations: Shows all possibly public associations on the diagram

  • Show All Associations: Shows all possible associations on the diagram

  • Show Associations as Members: Shows all association lines as members

  • Hide Private: Hides all private members

  • Hide Private and Internal: Hides all private and/or internal members

  • Show Only Public: Hides all members except for public; all hidden public members are shown

  • Show Only Public and Protected: Hides all members except for public and protected; all hidden public and/or protected members are shown

  • Show All Members: Shows all hidden members

18.9.2. Functionality Enhancements

PowerToys includes a number of enhancements that address some of the functional limitations of the Class Designer. While the Class Designer can display nested types, you cannot create them using the design surface.

This constraint is addressed by PowerToys by providing the ability to add nested types including classes, enumerations, structures, or delegates. You can also easily add several new member types, such as read-only properties and indexers.

There are also some improvements around working with interfaces. Often it is difficult to understand which members of a class have been used to implement an interface. PowerToys simplifies this by adding a Select Members menu item to the interface lollipop label on a type. For example, in Figure 18-12, the Select Members command is being invoked on the IStatus interface.

Figure 18.12. Figure 18-12

In addition to those we have mentioned here, there are many other minor enhancements and functionality improvements provided by PowerToys for the Class Designer that add up to make it a very useful extension.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.12.207