OutputWindowPane.OutputTaskItemString メソッド

更新 : 2007 年 11 月

出力ウィンドウに文字列を表示し、対応するアイテムをタスク一覧に追加します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
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 _
)
'使用
Dim instance As OutputWindowPane
Dim Text As String
Dim Priority As vsTaskPriority
Dim SubCategory As String
Dim Icon As vsTaskIcon
Dim FileName As String
Dim Line As Integer
Dim Description As String
Dim Force As Boolean

instance.OutputTaskItemString(Text, Priority, _
    SubCategory, Icon, FileName, Line, _
    Description, Force)
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
)
function OutputTaskItemString(
    Text : String, 
    Priority : vsTaskPriority, 
    SubCategory : String, 
    Icon : vsTaskIcon, 
    FileName : String, 
    Line : int, 
    Description : String, 
    Force : boolean
)

パラメータ

  • Text
    型 : System.String

    必ず指定します。[出力] ウィンドウに追加するテキスト。

  • SubCategory
    型 : System.String

    必ず指定します。新規タスク アイテムに使用するサブカテゴリ。

  • Icon
    型 : EnvDTE.vsTaskIcon

    必ず指定します。新規タスク アイテムに使用するアイコンを表す vsTaskIcon 定数。

  • FileName
    型 : System.String

    必ず指定します。新規タスク アイテムに関連付けるファイル名。空の文字列を指定できます。

  • Line
    型 : System.Int32

    必ず指定します。新規タスク アイテムに関連するコード行。

  • Description
    型 : System.String

    必ず指定します。新規タスク アイテムの説明。

  • Force
    型 : System.Boolean

    省略可能です。[出力] ウィンドウで [タスク一覧] を直接更新するかどうかを指定します。既定値は、True です。複数のアイテムを追加する場合は、Force を False に設定し、最後のアイテムの Force を True に設定します。

解説

[タスク一覧] に行番号を表示するには、FileName パラメータに完全パスを指定します (たとえば、c:\workfile.txt.)。このファイルは、指定した場所に存在する必要があります。理由は、行番号を表示する前に [出力] ウィンドウが、指定したファイルが存在するかどうかをチェックするためです。

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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

OutputWindowPane インターフェイス

OutputWindowPane メンバ

EnvDTE 名前空間