Share via


Breakpoint.Children 属性

获取此代码构造中包含的对象的集合。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property Children As Breakpoints
Breakpoints Children { get; }
property Breakpoints^ Children {
    Breakpoints^ get ();
}
abstract Children : Breakpoints with get
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 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例