How to: Work with Class View
You can navigate from the Code Editor to Class View to examine object members and project references. You can also navigate from Class View to lines of code where symbols are defined, referenced, and used.
Each symbol is represented by an icon indicating its type. To view a brief description of any symbol, hover over its icon. To expand a symbol and display its members, click the empty triangle symbol next to the icon or press the add (+) key on the numeric keypad.
In Visual C#, certain symbols, when selected, display their properties in the Properties window. These properties can be viewed and edited.
İpucu
To select multiple symbols simultaneously in Class View, press the SHIFT and CTRL keys as you click on them. This allows you to drag and drop groups of symbols.
Navigating from the Code Editor to Class View
As you edit your code, Class View updates its contents automatically to reflect the changes. As a result, you can select any symbol in the Code Editor and locate it instantly in the Class View hierarchy for the document you are editing.
To Synchronize Class View with the Code Editor
Open a code document for editing in the Code Editor.
Select Class View from the View menu to display the Class View window.
Right-click on a symbol in Class View and select Find All References from its shortcut menu.
In the Find Symbol Results window, double-click an entry to locate an instance of the symbol in your code.
Place the cursor in the line of code that includes the instance of the symbol
In the Find box on the Standard toolbar, type the following:
>View.SynchronizeClassView
Press ENTER.
Class View automatically scrolls to the location of the selected symbol in its hierarchy.
Navigating from Class View to Lines of Code
Class View provides several commands for navigating to definitions of symbols and their uses in code (references). You can navigate to symbols defined in your code by double-clicking them. The source file opens in the Code Editor and scrolls to the definition or declaration. If a symbol is defined elsewhere, its declaration is displayed in the Object Browser.
To navigate to a definition or declaration
Double-click the symbol.
—or—
Right-click the symbol and then choose either Go To Definition or Go To Declaration.
To browse a definition
Right-click the symbol and choose Browse Definition.
The Object Browser is displayed with the symbol selected. Its declaration appears in the Description pane.
To navigate to a reference
Right-click the symbol and choose Go To Reference.
The source file containing the reference opens in the Code Editor, with the insertion point placed at the reference.
Not
References might not be available for all project types.
To find a symbol
Right-click the symbol and choose Find All References.
This performs a search for the selected symbol using the options set in the Find Symbol, Find and Replace Window. Instances of the symbol found in your projects are listed in the Find Symbol Results Window.
See Also
Tasks
How to: Work with Folders in Class View
How to: Search for Objects, Definitions, and References (Symbols)
Reference
Class View and Object Browser Icons