Share via


Breakpoint2.FileLine 屬性

取得檔案中設有中斷點的行。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
ReadOnly Property FileLine As Integer
    Get
int FileLine { get; }
property int FileLine {
    int get ();
}
abstract FileLine : int
function get FileLine () : int

屬性值

型別:System.Int32
包含設有中斷點之原始程式碼行號的整數。

實作

Breakpoint.FileLine

備註

原始程式碼行號,從設有中斷點的函式開頭算起。 如果這項值為 1,中斷點會設定在檔案的開頭。 這個值是在 [新增中斷點、檔案] 對話方塊中的 [] 方塊中加以指定。

範例

下列範例示範如何使用 FileLine 屬性。

若要測試這個屬性:

  1. 請在目標應用程式中設定中斷點。

  2. 執行增益集。

public static void FileLine(EnvDTE80.DTE2 dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("FileLine property: ");
    owp.Activate();

    // dte is a reference to the DTE2 object passed to you by the
    // OnConnection method that you implement when you create an Add-in.
    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
    owp.OutputString("Breakpoint in the file " + debugger.Breakpoints.Item(1).File);
    owp.OutputString(" on line " +
                     debugger.Breakpoints.Item(1).FileLine.ToString() + " column ");
    owp.OutputString(debugger.Breakpoints.Item(1).FileColumn.ToString() + " is ");
    owp.OutputString(debugger.Breakpoints.Item(1).Enabled ? "enabled." : "disabled.");
    owp.OutputString("\nThis breakpoint is in the function: " +
                     debugger.Breakpoints.Item(1).FunctionName);
}

.NET Framework 安全性

請參閱

參考

Breakpoint2 介面

FileLine 多載

EnvDTE80 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例