The Task List


The Task List is essentially an integrated "to do" list; it captures all of the items that, for one reason or another, need attention and tracking. The Task List window then surfaces this list and allows you to interact with it. To show the window, select the View menu and choose the Task List entry. Figure 7.24 illustrates the Task List window displaying a series of user tasks. Tasks belong to one of three categoriescomment tasks, shortcut tasks, and user tasksand only one category can be displayed at a time.

Figure 7.24. The Task List window.


The drop-down at the top of the Task List window enables you to select the current category. Each category will have slightly different columns that it shows for each task category type, but they will all have a Priority and a Description column. For instance, user tasks and shortcut tasks provide a check box that is used to track task completion; shortcut and comment tasks display a filename and line number, and so on.

You can sort the tasks by any of the columns shown in the list. Right-clicking on the column headers will provide a shortcut menu that allows you to control the sort behavior, as well as which columns (from a list of all supported columns) should be displayed.

Comment Tasks

Comment tasks are created within your code. Placing a code comment with a special string literal/token will cause Visual Studio to add that comment to the comment task list. Three of these tokens are defined by Visual Studio: HACK, TODO, and UNDONE.

As an example, the following C# code would result in four different comment tasks in the task list:

namespace Contoso.Fx.Integration.Specialized {     //TODO: Implement second constructor     public class MessageMapper : IMessageSink     {         public MessageMapper()         {         }     }     //TODO: Check on IMap interface implementation     public class MessageBus : MessageMapper     {         public MessageBus()         {             //UNDONE: MessageBus ctor         }     }     //HACK: re-write of TokenStruct     public class ContextToken     {         public ContextToken()         {         }         public ContextToken(string guid)         {         }     } }


Double-clicking on the comment task will take you directly to the referenced comment line within the editor window.

Custom Comment Tokens

If needed, you can add your own set of tokens that will be recognized as comment tasks. From the Tools, Options dialog box, select the Task List page under the Environment section; this dialog box provides options for adding, editing, or deleting the list of comment tokens recognized by the task list.

In Figure 7.25 a REVIEW token has been added to the standard list. Note that you can also set a priority against each of the tokens and fine-tune some of the display behavior by using the Task List Options check boxes, which control whether task deletions are confirmed, and by setting whether filenames or complete file paths are displayed within the task list.

Figure 7.25. Adding a custom comment task token.


Shortcut Tasks

Shortcut tasks are actually links to a line of code. You add them using the Bookmarks menu by placing the cursor on a line within the editor and then selecting Edit, Bookmarks, Add Task List Shortcut. The actual content of that line of code will show up as the task description.

Double-clicking on the task will take you directly to the bookmarked line within the editor window.

User Tasks

User tasks are entered directly into the task window. A Create User Task button will show next to the category drop-down on the Task List window (refer to Figure 7.24); this button will add a new entry within the list. You can type directly into the description column to add the task's title.

Unlike shortcut and comment tasks, user tasks aren't linked to a specific line of code.

Note

Visual Studio's automation model provides complete control over task lists. Using the exposed automation objects such as TaskList and TaskListEvents, you can, for example, programmatically add or remove tasks from the list; respond to a task being added, edited, or even selected; and control the linking between a task and an editor.





Microsoft Visual Studio 2005 Unleashed
Microsoft Visual Studio 2005 Unleashed
ISBN: 0672328194
EAN: 2147483647
Year: 2006
Pages: 195

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