RAD Studio (Common)
ContentsIndex
PreviousUpNext
Exploring .NET Assembly Metadata Using the Reflection Viewer

You can open and explore the namespaces and types contained with a .NET assembly. The assembly metadata is displayed in the Reflection viewer, whose left pane contains a tree structure of the namespaces and types within the assembly. The right pane displays specific information on the selected item in the tree. The Call Graph tab shows you a list of the methods called by the selected method, as well as a list of the methods that call the selected method. 

You can open multiple .NET assemblies in the Reflection viewer. Each open assembly is displayed in the tree in the left-pane; the top-level node for a .NET assembly is denoted by the assembly node icon icon. 

There are several ways to open the Reflection viewer:

  • Choose FileOpen and selecting any managed assembly.
  • Use the Open context-menu command in the Project Manager.
  • Use the context-menu Browse Class command in the debugger Modules window.
  • Use the standalone application (Reflection.exe).
 

To close a particular .NET assembly, right-click the top-level assembly node icon icon and select Close.

To open the Reflection viewer from the menu

  1. Choose FileOpen.
  2. In the Open dialog box, from the Files of type drop-down list, select Assembly Metadata.
  3. Navigate to the folder where a .NET assembly is located. Select the assembly and click Open.
Tip: You can use the Browser buttons on the toolbar to navigate backwards and forwards to previously selected items in the left pane.

To open the Reflection viewer from the Project Manager

  1. Open a .NET application, such as an application for Delphi for .NET, for ASP.NET Web, or for VCL for .NET.
  2. In the Project Manager, right-click an assembly such as System.Data.dll.
  3. Select Open from the context menu.
The Reflection viewer, displayed in the Code Editor pane, contains tabs that correspond to the type of the item that is currently selected in the lefthand column of the viewer. When opened from the Project Manager, the Reflection viewer itself has a tab labeled with the class name, such as System.Data.dll.

To open the Reflection viewer from the debugger

  1. Open a .NET application, such as an application for Delphi for .NET, ASP.NET, or VCL for .NET.
  2. Press F8 to start the debugger.
  3. Select ViewDebug WindowsModules.
  4. Select any item in the Modules view. This populates the scope browser.
  5. In the scope browser, right-click a class, represented by the class icon: Namespace blue sphere icon
  6. Select the Browse Class command from the context menu.
The Reflection viewer, displayed in the Code Editor pane, contains tabs that correspond to the type of the item that is currently selected in the Modules window. When opened from the Modules window, the Reflection viewer itself has a tab labeled Browse<itemname>.

Using the Call Graph tab

  1. Select a method node in the left pane.
  2. Select the Call Graph tab. The top half of the Call Graph tab shows you a list of methods that call the method you selected in the left pane. The bottom half of the Call Graph tab shows you the methods called by the method you selected in the left pane. Methods that exist in the same assembly as the currently selected method appear as clickable links, and are displayed in blue underlined text. Clicking on a link causes that method to become selected in the tree in the left-hand pane.
    Note: The standalone Reflection
    viewer (Reflection.exe) has a Find button for searching an assembly, and two arrow buttons that move the viewer forward and backward in the viewer history.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!