Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

OutputWindowPane.OutputTaskItemString Method

Displays a string in the Output window and adds a corresponding item to the Task List.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)
void OutputTaskItemString(
	string Text,
	vsTaskPriority Priority,
	string SubCategory,
	vsTaskIcon Icon,
	string FileName,
	int Line,
	string Description,
	bool Force


Type: System.String

Required. The text to add to the Output window.

Type: EnvDTE.vsTaskPriority

Required. A vsTaskPriority constant representing the priority for the new task item.

Type: System.String

Required. The subcategory to use for the new task item.

Type: EnvDTE.vsTaskIcon

Required. A vsTaskIcon constant representing the icon to use for the new task item.

Type: System.String

Required. The file name to associate with the new task item. Can be an empty string.

Type: System.Int32

Required. The line of code to which the new task item relates.

Type: System.String

Required. The description of the new task item.

Type: System.Boolean

Optional. Indicates whether the Output window should immediately update the Task List. The default value is True. If you are adding several items, set Force to False, and then set Force to True on the last item.

For line numbers to appear in the Task List, must specify the full path in the FileName parameter. (For example, c:\workfile.txt.) The file must exist at that location. The reason for this is that the Output window checks to make sure the specified file exists before displaying line numbers.

Sub OutputTaskItemStringExample()
   ' Create a tool window handle for the Output window.
   Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
   ' Create handles to the Output window and its panes.
   Dim OW As OutputWindow = win.Object
   Dim OWp As OutputWindowPane

   ' Add a new pane to the Output window.
   OWp = OW.OutputWindowPanes.Add("A New Pane")
   ' Add a line of text to the new pane and to the Task List.
   OWp.OutputTaskItemString("Some task", vsTaskPriority.vsTaskPriorityHigh, vsTaskCategories.vsTaskCategoryMisc, vsTaskIcon.vsTaskIconComment, "C:\temp", 100, "Some description")
   ' You can also use the 'True' flag on the end of OutputTaskItemString 
   ' rather than using the next line (ForceItemsToTaskList).
End Sub
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.