Export (0) Print
Expand All

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 (
	[InAttribute] string Text,
	[InAttribute] vsTaskPriority Priority,
	[InAttribute] string SubCategory,
	[InAttribute] vsTaskIcon Icon,
	[InAttribute] string FileName,
	[InAttribute] int Line,
	[InAttribute] string Description,
	[OptionalAttribute] [InAttribute] bool Force
)
void OutputTaskItemString (
	/** @attribute InAttribute() */ String Text, 
	/** @attribute InAttribute() */ vsTaskPriority Priority, 
	/** @attribute InAttribute() */ String SubCategory, 
	/** @attribute InAttribute() */ vsTaskIcon Icon, 
	/** @attribute InAttribute() */ String FileName, 
	/** @attribute InAttribute() */ int Line, 
	/** @attribute InAttribute() */ String Description, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean Force
)
function OutputTaskItemString (
	Text : String, 
	Priority : vsTaskPriority, 
	SubCategory : String, 
	Icon : vsTaskIcon, 
	FileName : String, 
	Line : int, 
	Description : String, 
	Force : boolean
)

Parameters

Text

Required. The text to add to the Output window.

Priority

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

SubCategory

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

Icon

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

FileName

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

Line

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

Description

Required. The description of the new task item.

Force

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

Community Additions

ADD
Show:
© 2014 Microsoft