Udostępnij za pośrednictwem


Object Browser

The Object Browser lets you select and examine the namespaces, classes, methods, and other programming symbols available for use in your project. You can open the Object Browser from the View menu, by clicking the Object Browser button on the main toolbar, or by typing CTRL+ALT+J.

Warning

The descriptions in this topic are based on the Visual Studio Professional edition. The dialog boxes and menu commands you see might differ from those described here, depending on your settings or Visual Studio edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, Working with Settings.

There are three panes: an Objects pane on the left, a Members pane on the upper right, and a Description pane on the lower right. If you resize the Object Browser into a single column, the Objects pane moves to the top, the Members pane to the middle, and the Description pane to the bottom.

In the Objects pane, icons identify hierarchical structures such as .NET Framework and COM components, namespaces, type libraries, interfaces, enums, and classes. You can expand these structures to reveal ordered lists of their members. Properties, methods, events, variables, constants, and other contained items are listed in the Members pane. Details on the item selected in the Objects pane or Members pane appear in the Description pane. 

The browsing scope drop down list lets you specify any .NET Framework version installed on your computer. It can also be narrowed to the projects you are developing and the components they reference, or expanded to include all of the .NET Framework, all COM components installed on your computer, and all external components that you can access. You also can specify a custom set of folders to browse. For more information, see How to: Modify the Browsing Scope in the Object Browser.

For more information about how to use the Object Browser, see Browsing Through Code and Components. For a guide to the icons displayed, see Class View and Object Browser Icons.

This topic is organized in to the following sections:

  • Object Browser Toolbar

  • Objects Pane

  • Members Pane

  • Description Pane

  • Symbol Help

Object Browser Toolbar

The Object Browser toolbar lets you define the browsing scope, search for objects, navigate in the Objects and Members panes, add references to a project, select a logical or physical view, select items to be displayed, and sort those items as you want.

Browse Menu

Specifies the browsing scope for the Objects pane. You can narrow the scope to the current solution, or expand the scope to include every available component. Within any scope, you can use Search to display a subset of the available components. You also can select Edit Custom Component Set to define the Custom Component Set browsing scope.

  • All Components
    Displays objects in all of the .NET Framework, the current solution and its referenced components, and any other components that you have added by selecting Edit Custom Component Set.

  • <Framework Versions>
    You can select to display objects for a specific version of the .NET Framework and the .NET Compact Framework. For example, if you have .NET Framework 2.0 and the .NET Framework 3.0 on your computer, you can choose to display only .NET Framework 3.0. Registered third-party frameworks may also be displayed.

  • My Solution
    Displays objects in the current solution and its referenced components.

  • Custom Component Set
    Displays objects in any components that you have added by selecting Edit Custom Component Set.

  • Edit Custom Component Set
    Displays the Edit Custom Component Set Dialog Box. You also can click the Browse (...) button to display this dialog box. Allows you to select object hierarchies from your projects, from components referenced in your projects, and from external components.

Search Menu

The Search menu lets you locate objects in the Objects pane. You can either select a previous search string or enter a new one. The results are displayed in the Objects pane as a filtered sublist of its original content. To redisplay the complete Browse scope, click Clear Search. A search returns all symbol names in the current browsing scope where the search string matches any part of the symbol name. For example, a search on the string "MyObject" will return the names "MyObject," "MyObjectTest" and "CMyObject." Searches are case-sensitive.

  • Search String
    Allows you to select a string from the dropdown menu, or to enter a new search string. You can enter the full name of a symbol or a substring that appears in many symbols.

  • Search
    Click this button to display just those objects in the Browse scope whose names include the Search String. The string is highlighted in each symbol name where it is matched.

  • Clear Search
    Click this button to clear the Search String field and display all available objects in the Browse scope.

Toolbar Buttons

The Object Browser toolbar buttons lets you navigate in the Objects pane and the Members pane, and to add references to a project.

  • Back
    Navigates to the previously selected item. Keep clicking this button to navigate through previously selected items until you reach the first item browsed. The Back and Forward buttons move through a history list of previously browsed items.

  • Forward
    Becomes available when you click the Back button. Navigates to the next item selected. Keep clicking this button to return to the most recent item selected. The Back and Forward buttons move through a history list of items previously browsed.

  • Add to References in Selected Project
    Inserts a reference to the selected component into the project currently selected in Solution Explorer. For more information, seeHow to: Add or Remove References in Visual Studio.

Object Browser Settings

The Object Browser Settings menu on the Object Browser toolbar lets you select a particular view of the objects in the current Browse scope, and to specify which of the available objects will be displayed. The available choices are in the following list. Some of these commands are also available from the shortcut menus in the Objects and Members panes.

  • View Namespaces
    When selected, the highest-level items in the Objects pane are logical namespaces. Namespaces stored in multiple physical containers are merged. These expand to show the class types that are contained.

  • View Containers
    When selected, the highest-level items in the Objects pane are physical containers, such as components, assemblies, source browser (.bsc) files, and output type libraries (.tlb). These expand to show the namespaces that are contained.

  • Show Base Types
    Toggles display of base types in the Objects pane.

  • Show Derived Types
    Toggles display of derived types in the Objects pane. Available only for Visual C++ projects and the .NET Framework.

  • Show Hidden Types and Members
    Toggles display of hidden types in the Objects pane and hidden members in the Members pane.

  • Show Public Members
    Members that are public are displayed for users who are using the classes.

  • Show Protected Members
    Members that are public or protected are displayed for users who are extending the classes.

  • Show Private Members
    Members of all accessibility levels are displayed for users who are implementing and using the classes.

  • Show Other Members
    Members that do not fall into the category of public, protected, private, or inherited are displayed. Examples:

    In the following Visual Basic code, "Friend" is included in this category:

    Friend Sub Test()
    End Sub
    

    In the following Visual C# code, "internal" is included in this category:

    internal void InternalF() { }
    
  • Show Inherited Members
    Toggles display of inherited members in the Members pane.

  • Show Extension Methods
    Toggles the display of extension methods in the Members pane. For more information, see Extension Methods (C# Programming Guide) and Extension Methods (Visual Basic).

Objects Pane

The Objects pane displays an expandable list of symbols whose top-level nodes represent components or namespaces available in the current browsing scope. These top-level nodes typically contain symbols that contain other symbols. To expand a node selected in the list, click its plus (+) sign or press the plus (+) key on the keypad.

When you select an item in the Objects pane, its members are displayed in the Members pane, and details on the item appear in the Description pane. Expanding a node provides additional information about a symbol. When you expand a component, its namespaces are listed. Expanding a namespace lists the classes that are defined in it. Base classes, implemented interfaces, extension methods, and available overrides are also listed.

Nested objects are flattened and listed as peers. For example, if parent class CMyClass includes a subclass CNestedClass, these two classes are displayed as siblings within their namespace. Their Object Browser nodes are labeled CMyClass and CMyClass::CnestedClass in Visual C++ and CMyClass.CnestedClass in Visual C# and Visual Basic, to indicate that the former class contains the latter.

Objects Pane Shortcut Menu

Right-clicking a symbol displays the Objects pane shortcut menu. In addition to the Object Browser Settings commands listed earlier, one or more of the following commands can appear on this menu, depending on the symbol selected:

  • Browse Definition
    Takes you to the primary node (typically top level) for the selected symbol in the Object Browser.

  • Find All References
    Performs a search on the currently selected object symbol using the options specified on the Find Symbol, Find and Replace Window. Displays results in the Find Symbol Results Window window.

  • Filter To Type
    Displays only the selected type in the Objects pane, and the members of that type in the Members pane.

  • Copy
    Copies a symbol reference that can be pasted into a designer; also copies the full path and name of the selected item to the Clipboard.

  • Remove
    Lets you remove an external component from the current browsing scope by using the Selected Components dialog box.

  • View Namespaces
    When selected, the highest-level items in the Objects pane are logical namespaces. Namespaces stored in multiple physical containers are merged. These expand to show the class types that are contained.

  • View Containers
    When selected, the highest-level items in the Objects pane are physical containers, such as projects, components, assemblies, source browser (.bsc) files, and output type libraries (.tlb). These can be expanded to show the namespaces they contain.

  • Sort Alphabetically
    Objects are listed alphabetically by their names in ascending order (A to Z).

  • Sort by Object Type
    Objects are listed in order of their type, such as base classes, followed by derived classes, interfaces, methods, and so forth.

  • Sort by Object Access
    Objects are listed in order of their access type, such as public or private.

  • Group by Object Type
    Objects are sorted into groups by type, such as classes, interfaces, properties, methods, and so forth.

  • Go To Declaration
    Takes you to the declaration of the symbol in the code, if available. This is available only in Visual C++ projects.

  • Go To Definition
    Takes you to the definition of the symbol in the code, if available.

  • Go To Reference
    Takes you to a reference to the symbol in the code, if available.

Members Pane

Each object can contain such members as properties, methods, events, constants, variables, and enum values. Selecting an object in the Objects pane displays its members in the Members pane. Details on the item selected in the Members pane appear in the Description pane.

Members Pane Shortcut Menu

Right-click any member in the Members pane to display the shortcut menu. This menu lets you search, sort, and copy members independently from their parent objects. This shortcut menu also includes commands that let you specify which members to display, for example whether to view hidden or inherited members.

  • Find All References
    Performs a search on the currently selected member symbol using the options specified on the Find Symbol, Find and Replace Window. Displays results in the Find Symbol Results Window window.

  • Copy
    Copies a symbol reference that can be pasted into a designer; also copies the full path and name of the selected item to the Clipboard.

  • Group By Member Type
    Members are organized by type.

  • Show Public Members
    Members that are public are displayed for users who are using the classes.

  • Show Protected Members
    Members that are public or protected are displayed for users who are extending the classes.

  • Show Private Members
    Members of all accessibility levels are displayed for users who are implementing and using the classes.

  • Show Other Members
    Members that do not fall into the category of public, protected, private, or inherited are displayed. Examples:

    In the following Visual Basic code, "Friend" is included in this category:

    Friend Sub Procedure()
    End Sub
    

    In the following Visual C# code, "internal" is included in this category:

    internal void InternalF() { }
    
  • Show Inherited Members
    Toggles display of inherited members in the Members pane.

  • Sort Alphabetically
    Members are listed alphabetically by their names in ascending order (A to Z).

  • Sort by Member Type
    Members are listed in order of their type, such as bases, followed by interfaces, followed by methods, and so forth.

  • Sort by Member Access
    Members are listed in order of their access type, such as public or private.

Description Pane

The Description pane displays detailed information about the currently selected object or member. You can copy data from the Description pane to the Clipboard, and then paste it into the Code Editor. The information displayed depends on the selection and can include the following:

  • Name and parent object.

  • Properties and attributes.

  • Syntax in the programming language of the active project.

  • Links to related objects and members.

  • Descriptions, comments, and Help text.

  • Version of the .NET Framework in which the object or member is included.

The type of symbol selected determines what information is displayed.

Browse Definition

The Browse Definition command is available on the shortcut menu of the Description pane, and for deeply nested nodes in the Object Browser. It is also available on the shortcut menus of the Code Editor, Class View, and the Find Symbol Results window when a symbol is selected.

If the symbol is defined in your code, the source file opens in the Code Editor and scrolls to the definition. If the symbol is a .NET Framework class or COM component, Go To Definition selects its primary node in the Objects pane, lists its members in the Members pane, and displays details on the symbol in the Description pane.

Symbol Help

You can press F1 on any symbol to view a Help topic about it, if one is available. This applies not only to .NET Framework and COM components, but also to many third-party components.

See Also

Tasks

How to: Navigate in the Object Browser

How to: Search for Objects, Definitions, and References (Symbols)

Reference

Class View

Other Resources

Viewing Classes and Their Members