A week or so ago a developer who was starting to use VS 2005 mentioned that he was a big fan of the Class View and was disappointed to see that it was no longer possible to synchronize the Class View with the editor. In VS 2003 this was possible via a command called ‘View.SynchronizeClassView’ that appeared on the editor context menu. This command was removed in VS 2005 based off of the command usage data collected during the Beta and CTP releases, in an effort to reduce clutter.
The good news is that the command was only removed from the menu, not the product. The better news is that Visual Studio actually has an extensive mechanism for customizing layout, including the names, order, icons, etc. of commands that appear on menus.
In order to move the command back onto the editor context menu, follow these steps:
1. Select Tools | Customize…
2. In the tabbed dialog that appears, search through the checked list box list, on the “Toolbars” page, for an item called “Context Menus”. Check it.
This causes a new toolbar to appear at the top of the screen underneath the toolbars that are already showing. This toolbar is only visible when the Customize dialog is showing.
3. Change the active page from “Toolbars” to “Commands” (on the Customize dialog)
4. In the Categories list box, select View
5. The right-hand pane, “Commands”, will be updated to show all of the commands prefixed with “View.” Scroll through that list and find SyncrhonizeClassView (the list is alphabetically ordered).
6. Drag that command from the “Commands” list on to the Editor Context Menu | Code Window item in the toolbar that appeared when we selected “Context Menus.” You can put it wherever seems appropriate on the menu.
7. Close the Customize dialog
The editor context menu now contains the command, and whenever you’re in source you can right-click and select Synchronize Class View, just as in VS 2003. This same process can be used to change the order of commands that appear on the menus, their names, the icons associated with them, their accelerator keys. You can even delete commands that are cluttering the menu that you never use. These customizations can even be preserved into a .vssettings file and shared on multiple machines or with coworkers.
The question got me thinking about Class View and how people are currently using it. I’m curious:
- Do you use Class View? (If not, do you use any tool that works like Class View, the Navigation Bar, or maybe an addin?)
- If you use Class View, do you tend to use it for navigation, browsing, or both?
- Class View used to provide a set of ‘Add’ commands for adding new methods and classes. Did you use those? Do you miss them in 2005?
- Do you like the split screen view of the Class View vs. how it appeared in VS 2003?
- What requests do you have for Class View in the future?