Section D: Tasks, Output, Search Results, and Watches

I l @ ve RuBoard

Section D: Tasks , Output, Search Results, and Watches

In this section, you will again find a tabbed window with several panes. This section of the screen deals with tasks, output from the build process, debug trace information, results of searches from the help Index and Search panes, and the results of symbol searches within your applications. Figure 1.5.13 shows a view of area E from the illustration in Figure 1.5.1.

Figure 1.5.13. The task, output, and search results panel.

graphics/0105fig13.gif

Tasks

Programmers working with Visual C++ over its last few incarnations will be used to the // TODO comments that appear in the wizard-generated code. These comments usually told you what portions of the auto-generated implementation still needed to be filled in. You only needed to find the TODO markers with a quick file search and you could see how complete the code was.

Visual Studio.NET now automates the task tracking process for you. Whenever you enter the // TODO comment in your code, the IDE will place a task in the task list for you. Double-clicking that task will take you to the comment in the code. In addition to the built-in tags TODO , HACK , and UNDONE , you can put in your own custom tags that will also show up in the task list.

Figure 1.5.14 shows the task list in relation to a TODO task that has been placed in the code.

Figure 1.5.14. The task list.

graphics/0105fig14.gif

To add your own task list tag, select Tools, Options from the main menu, and then select Environment, Task List from the tree of setup options in the left pane of the dialog. By default, these tasks might be hidden in the task window. To see all your tasks, right-click the task pane, select Show Tasks, and select All.

Output Details

Selecting the Output tab might show you several panes of information. Build messages, including warnings and errors, will be displayed here. Messages from debugging traces are also available here, as well as certain messages from other programs such as those invoked through the command line and by the IDE.

You can place your own messages here, particularly when debugging, by using the System.Diagnostics.Trace object. For example, when handling a timer event in a C# program, the code shown in Listing 1.5.1 illustrates this technique.

Listing 1.5.1 Using the Trace Object to Output to the Debug Pane
 private void OnTick(object sender, System.EventArgs e) {    System.Diagnostics.Trace.Write("The timer ran!!\ n","Timer"); } 

This snippet of code produces the result seen in Figure 1.5.15.

Figure 1.5.15. Trace activity in the output pane.

graphics/0105fig15.gif

As you can see, the message "The timer ran!!" was displayed for category "Timer" several times as the program ran.

Find Symbol Results

Pressing Alt+F12 or selecting Edit, Find and Replace, Find Symbol will bring up the Find Symbol dialog. With this dialog, you can search for a symbol in your own application files, references already in the project, or any other component that you select. The results are displayed in the Find Symbol results pane. Right-clicking an entry in that pane will allow you to go to the definition in the editor or browse the definitions and references for that symbol. Selecting Browse Definition will bring up the Object Browser pane in the main window where you can see the whole object hierarchy tree for the selected object and others in its assembly.

Figure 1.5.16 shows the steps required to do a symbol search in VS.NET.

Figure 1.5.16. Using the Find Symbol dialog.

graphics/0105fig16.gif

The object browser interface is a little different than the Browser Info in VS 6.0. The browser information in the previous version had to be built explicitly. The Object Browser in VS.NET is available all the time, even before you do your first build, and is far more useful for your general day-to-day development tasks. The browser consists of three panes ”the Object pane (left), the Members pane (right), and the Description pane (bottom). In addition, a toolbar above it allows you to select other options. Using the Object Browser, you can explore namespaces, classes, types, interfaces, enum s, and structures. You can optionally sort objects in the Browser Pane by using the Object Browser toolbar to sort members alphabetically , by type, by object access, or grouped by object type. The image in Figure 1.5.17 shows the results of a search for InitializeComponent and the resultant state of the Object Browser.

Figure 1.5.17. The Object Browser.

graphics/0105fig17.gif

Index and Search Results

Both of these panes display the results of help contents searches, either by a simple index request or through a more complex search. Clicking a search result takes you to the help entry.

Debug Windows

Some other panes appear in this section. They are the Breakpoint pane and the immediate command window. We will explain these panes in the "Debugging Programs" section later in this chapter.

I l @ ve RuBoard


C# and the .NET Framework. The C++ Perspective
C# and the .NET Framework
ISBN: 067232153X
EAN: 2147483647
Year: 2001
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net