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)

Syntax

'Declaration
Sub OutputTaskItemString ( _
    Text As String, _
    Priority As vsTaskPriority, _
    SubCategory As String, _
    Icon As vsTaskIcon, _
    FileName As String, _
    Line As Integer, _
    Description As String, _
    Force As Boolean _
)
void OutputTaskItemString(
    string Text,
    vsTaskPriority Priority,
    string SubCategory,
    vsTaskIcon Icon,
    string FileName,
    int Line,
    string Description,
    bool Force
)
void OutputTaskItemString(
    [InAttribute] String^ Text, 
    [InAttribute] vsTaskPriority Priority, 
    [InAttribute] String^ SubCategory, 
    [InAttribute] vsTaskIcon Icon, 
    [InAttribute] String^ FileName, 
    [InAttribute] int Line, 
    [InAttribute] String^ Description, 
    [InAttribute] bool Force
)
abstract OutputTaskItemString : 
        Text:string * 
        Priority:vsTaskPriority * 
        SubCategory:string * 
        Icon:vsTaskIcon * 
        FileName:string * 
        Line:int * 
        Description:string * 
        Force:bool -> unit
function OutputTaskItemString(
    Text : String, 
    Priority : vsTaskPriority, 
    SubCategory : String, 
    Icon : vsTaskIcon, 
    FileName : String, 
    Line : int, 
    Description : String, 
    Force : boolean
)

Parameters

  • Text
    Type: System.String

    Required. The text to add to the Output window.

  • SubCategory
    Type: System.String

    Required. The subcategory 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.

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.

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

.NET Framework Security

See Also

Reference

OutputWindowPane Interface

EnvDTE Namespace