Share via


Breakpoint2.Name 屬性

設定或傳回中斷點名稱。

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

語法

'宣告
Default Property Name As String
    Get
    Set
string this { get; set; }
property String^ default {
    String^ get ();
    void set (String^ value);
}
abstract Name : string with get, set
function get Name () : String
function set Name (value : String)

屬性值

型別:System.String
字串,包含中斷點的名稱。

實作

Breakpoint.Name

範例

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

若要測試這個屬性:

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

  2. 在 [屬性/叫用次數] 對話方塊中設定各種中斷點屬性。

  3. 執行增益集。

public static void Name(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("Name 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("HitCountTarget: " +
                        debugger.Breakpoints.Item(1).HitCountTarget);
    owp.OutputString("\nHitCountType: " +
                        debugger.Breakpoints.Item(1).HitCountType);
    owp.OutputString("\nLocationType: " +
                        debugger.Breakpoints.Item(1).LocationType);
    owp.OutputString("\nName: " + debugger.Breakpoints.Item(1).Name);
    debugger.Breakpoints.Item(1).Tag = "My Breakpoint";
    owp.OutputString("\nTag: " + debugger.Breakpoints.Item(1).Tag);
    owp.OutputString("\nType: " + debugger.Breakpoints.Item(1).Type); 
}

.NET Framework 安全性

請參閱

參考

Breakpoint2 介面

Name 多載

EnvDTE80 命名空間

其他資源

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