Freigeben über


OutputWindowPane.OutputTaskItemString Method

Definition

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

void OutputTaskItemString(std::wstring const & Text, EnvDTE::vsTaskPriority Priority, std::wstring const & SubCategory, EnvDTE::vsTaskIcon Icon, std::wstring const & FileName, int Line, std::wstring const & Description, bool Force = true);
[System.Runtime.InteropServices.DispId(9)]
public void OutputTaskItemString (string Text, EnvDTE.vsTaskPriority Priority, string SubCategory, EnvDTE.vsTaskIcon Icon, string FileName, int Line, string Description, bool Force = true);
[<System.Runtime.InteropServices.DispId(9)>]
abstract member OutputTaskItemString : string * EnvDTE.vsTaskPriority * string * EnvDTE.vsTaskIcon * string * int * string * bool -> unit
Public Sub OutputTaskItemString (Text As String, Priority As vsTaskPriority, SubCategory As String, Icon As vsTaskIcon, FileName As String, Line As Integer, Description As String, Optional Force As Boolean = true)

Parameters

Text
String

Required. The text to add to the Output window.

Priority
vsTaskPriority

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

SubCategory
String

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

Icon
vsTaskIcon

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

FileName
String

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

Line
Int32

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

Description
String

Required. The description of the new task item.

Force
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.

Attributes

Examples

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  

Remarks

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.

Applies to