Condividi tramite


Metodo OutputWindowPane.OutputTaskItemString

Visualizza una stringa nella finestra di output e aggiunge un elemento corrispondente all'Elenco attività.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
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
)

Parametri

  • Text
    Tipo: System.String
    Obbligatorio.Testo da aggiungere alla finestra di output.
  • SubCategory
    Tipo: System.String
    Obbligatorio.La sottocategoria da utilizzare per la nuova attività.
  • FileName
    Tipo: System.String
    Obbligatorio.Il nome del file da associare alla nuova attività.Può essere una stringa vuota.
  • Line
    Tipo: System.Int32
    Obbligatorio.Riga di codice a cui si riferisce la nuova attività.
  • Description
    Tipo: System.String
    Obbligatorio.La descrizione della nuova attività.
  • Force
    Tipo: System.Boolean
    Facoltativo.Indica se l'Elenco attività nella finestra di output deve essere immediatamente aggiornato.Il valore predefinito è True.Se si aggiungono più elementi, impostare Force su False e quindi su True per l'ultimo elemento.

Note

Per visualizzare i numeri di riga nell'Elenco attività, è necessario specificare il percorso completo nel parametro FileName, Ad esempio, c:\workfile.txt. Il file in questione deve essere collocato in tale posizione. Infatti, tramite la finestra di output, viene verificata l'esistenza del file specificato prima della visualizzazione dei numeri di riga.

Esempi

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

OutputWindowPane Interfaccia

Spazio dei nomi EnvDTE