4.6. Code View
As a developer you're likely to spend a considerable portion of your time writing code, which means that knowing how to tweak the layout of your code and being able to navigate it effectively are particularly important.
4.6.1. Forward/Backward
As you move within and between items, Visual Studio 2008 tracks where you have been, in much the same way that a web browser tracks the sites you have visited. Using the Navigate Forward and Navigate Backward items from the View menu, you can easily go back and forth between files that you are working on. The keyboard shortcut to navigate backward is Ctrl+−. To navigate forward again it is Ctrl+Shift+−.
4.6.2. Regions
Effective class design usually results in classes that serve a single purpose and are not overly complex or lengthy. However, there will be times when you have to implement so many interfaces that your code file will become unwieldy. In this case you have a number of options, such as partitioning the code into multiple files or using regions to condense the code, thereby making it easier to navigate.
The introduction of partial classes means that at design time you can place code into different physical files representing a single logical class. The advantage of using separate files is that you can effectively group all methods that are related, for example, methods that implement an interface. The problem with this strategy is that navigating the code then requires continual switching between code files.
Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.