2014年6月19日木曜日

Visual Studio 2013 SDK で拡張機能を作りたい その2

出力ウィンドウに割り込みたいので、まずは調査から。

This example shows how to parse a standard build message for errors, and add an item to the Error window, if appropriate, before the message is sent to the Output window.
この例では、エラーの標準のビルドメッセージを解析し、適切な場合には、メッセージが出力ウィンドウに送信される前に、エラーウィンドウに項目を追加する方法を示しています。

void OutputTaskItemStringExExample(string buildMessage,
    IVsOutputWindowPane buildPane, IVsLaunchPad launchPad)
{
    uint[] priority = new uint[1], lineNumber = new uint[1];
    string[] fileName = new string[1], taskItemText = new string[1];
    int[] taskItemFound = new int[1];

    // buildMessageにエラーが含まれているかどうかを判断する
    launchPad.ParseOutputStringForTaskItem(
        buildMessage, 
        priority, 
        fileName, 
        lineNumber, 
        taskItemText, 
        taskItemFound);


    // buildMessageにエラーがある場合は、エラーウィンドウと[出力]
    // ウィンドウの両方に送信します。
    // そうでなければ、唯一の[出力]ウィンドウに送信します。
    if (taskItemFound[0] != 0)
    {
        buildPane.OutputTaskItemStringEx(
            buildMessage, 
            (VSTASKPRIORITY)priority[0], 
            VSTASKCATEGORY.CAT_BUILDCOMPILE, 
            null, 
            0, 
            fileName[0], 
            lineNumber[0], 
            taskItemText[0], 
            null);
    }
    else
    {
        buildPane.OutputString(buildMessage);
    }

    buildPane.OutputString("\n");
}

でも、どうやって動かすのか、検討もつかない・・・orz

0 件のコメント:

コメントを投稿