Share via


Breakpoint.Children 屬性

取得包含在這個程式碼建構中之物件的集合。

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

語法

'宣告
ReadOnly Property Children As Breakpoints
    Get
Breakpoints Children { get; }
property Breakpoints^ Children {
    Breakpoints^ get ();
}
abstract Children : Breakpoints
function get Children () : Breakpoints

屬性值

型別:EnvDTE.Breakpoints
Breakpoints 集合。

備註

如果 Breakpoint 沒有子系,則會傳回 Nothing。

當設計模式中所設定的暫止中斷點,繫結至中斷模式或執行模式的特定應用程式執行個體時,則會建立子系。

範例

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

若要測試這個屬性:

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

  2. 執行增益集。 中斷點的子系個數為零。

  3. 在偵錯模式執行目標應用程式。

  4. 當程式在中斷點上停止時,請執行增益集。 子系個數為零。

public static void Children(DTE 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("Children Property Test");
    owp.Activate();

    //dte is a reference to the DTE object passed to you by the
    //OnConnection method that you implement when you create an add-in.
    EnvDTE.Debugger debugger = (EnvDTE.Debugger)dte.Debugger;
    owp.OutputString("Number of children: " + debugger.Breakpoints.Item(1).Children.Count.ToString());
}
Shared Sub Children(ByRef dte As EnvDTE.DTE)
    MessageBox.Show("Number of children: " + _
                    dte.Debugger.Breakpoints.Item(1).Children().Count().ToString())
End Sub

.NET Framework 安全性

請參閱

參考

Breakpoint 介面

EnvDTE 命名空間

其他資源

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