Visual Studio Hacks
Addins Documentation

Class Designer Powertoy

by javery on March 1, 2008

Visual Studio 2005’s Distributed System and Class Designers enable developers and architects to lay out systems and software on a visual basis. The designers are powerful tools in their own right, but lack formatting, and diagram layout commands. The Designers also don’t make it very easy to navigate through diagrams.

The Visual Studio 2005 Class Designer and Distributed System Designers PowerToy add-in greatly increases the functionality of both designers. The PowerToy also gives developers a framework for creating custom add-ins to the tool.

Download and install the PowerToy from its workspace on GotDotNet to gain the new functionality. Enhancements provided by the PowerToy are broken into two categories: Design Tools enhancements and Class Designer enhancements. Enhancements are generally accessible through the Class Diagram or Distributed System Diagram menu. The right-click context menu has been enhanced with a few options such as class enhancements and exporting to Web image.

The Design Tool enhancements improve your ability to work on class diagram drawings. You’re able to search diagrams for various attributes/classes, pan and zoom the window, and display a floating properties window. You also get powerful format and layout capabilities such as aligning shapes and changing Z-order layouts.

Additionally, scrolling in the designer has been improved. Users with a mouse wheel can click the wheel and drive the mouse around to pan the design form. You’ll also gain the use of a grid for aligning objects on the design surface.

One new feature allows you to create XML comments on the diagram by double-clicking any empty space on the designer form. Note these comments aren’t associated with any particular class or object on the diagram; rather, they’re simply comments added to the XML file which defines the diagram. Use these comments for adding any general documentation you might think necessary.

The screenshot above shows a Class Designer with an XML comment, the floating properties box, an interface lollipop, inheritance/association dongles, and the pan window.

The Class Designer enhancements improve how you’re able to view and interact with classes on the designer form. You’re also able to look up MSDN help on system types and export the diagram as a web page, complete with popup graphics detailing comments for all classes and members. Additionally, changes to elements on the diagram are automatically synchronized in the code definition file.

View capabilities include filtering (turning off) the display of a number of items for classes: inheritance and association lines, gradients and shape controls, and members within classes. XML comments for classes and members can also be displayed. Panning on the diagram is easily accomplished by pressing Ctrl + Alt and dragging the cursor to pan.

Interface members can quickly be selected in an implementing class, various inheritances can be displayed, and types can quickly be displayed.

A great deal of interaction has been added via the PowerToy. Dongles for inheritance and association enable you to rapidly define relationships on the diagram. “Add” commands have been implemented to create types, members, structures, elements and derived classes in objects on the diagram. If Team System Test components are installed you can quickly create tests for classes or members with new menu options.

blog comments powered by Disqus

Previous post: Annoucing the Visual Studio Hacks forums!

Next post: GhostDoc