OutputWindowPane::OutputTaskItemString Method (String^, vsTaskPriority, String^, vsTaskIcon, String^, Int32, String^, Boolean)

 

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 = true
)

Parameters

Text
Type: System::String^

Required. The text to add to the Output window.

Priority
Type: EnvDTE::vsTaskPriority

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

SubCategory
Type: System::String^

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

Icon
Type: EnvDTE::vsTaskIcon

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

FileName
Type: System::String^

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

Line
Type: System::Int32

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

Description
Type: System::String^

Required. The description of the new task item.

Force
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).
   OWp.ForceItemsToTaskList()
End Sub
Return to top
Show: