Breakpoint2 接口
包含用于以编程方式操作断点的属性和方法。
命名空间: EnvDTE80
程序集: EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
<GuidAttribute("FBC8D85A-E449-4CB3-B026-F7808DEB7792")> _
Public Interface Breakpoint2 _
Inherits Breakpoint
[GuidAttribute("FBC8D85A-E449-4CB3-B026-F7808DEB7792")]
public interface Breakpoint2 : Breakpoint
[GuidAttribute(L"FBC8D85A-E449-4CB3-B026-F7808DEB7792")]
public interface class Breakpoint2 : Breakpoint
[<GuidAttribute("FBC8D85A-E449-4CB3-B026-F7808DEB7792")>]
type Breakpoint2 =
interface
interface Breakpoint
end
public interface Breakpoint2 extends Breakpoint
Breakpoint2 类型公开以下成员。
属性
名称 | 说明 | |
---|---|---|
BreakWhenHit | 获取或设置一个值,该值指示在遇到断点时程序是否中断。 | |
Children | (继承自 Breakpoint。) | |
Children | 获取所有 Breakpoint2 子对象的集合。 | |
Collection | (继承自 Breakpoint。) | |
Collection | 获取包含所有 Breakpoint2 对象的集合。 | |
Condition | (继承自 Breakpoint。) | |
Condition | 获取触发断点的条件。 | |
ConditionType | (继承自 Breakpoint。) | |
ConditionType | 获取断点的条件类型,可以为在条件为真时中断,或在条件更改时中断。 | |
CurrentHits | (继承自 Breakpoint。) | |
CurrentHits | 获取在此调试会话过程中命中此断点的次数。 | |
DTE | (继承自 Breakpoint。) | |
DTE | 获取顶级扩展性对象。 | |
Enabled | (继承自 Breakpoint。) | |
Enabled | 设置或返回断点的启用状态。 | |
File | (继承自 Breakpoint。) | |
File | 获取包含断点的文件的名称。 | |
FileColumn | (继承自 Breakpoint。) | |
FileColumn | 获取设置断点的字符位置(在文件中的某一行内)。 | |
FileLine | (继承自 Breakpoint。) | |
FileLine | 获取文件中设置断点的行。 | |
FilterBy | 获取或设置设定断点的条件。 | |
FunctionColumnOffset | (继承自 Breakpoint。) | |
FunctionColumnOffset | 获取距离函数断点名称的列偏移量。 | |
FunctionLineOffset | (继承自 Breakpoint。) | |
FunctionLineOffset | 获取距离函数断点名称的行偏移量。 | |
FunctionName | (继承自 Breakpoint。) | |
FunctionName | 获取包含断点的函数的名称。 | |
HitCountTarget | (继承自 Breakpoint。) | |
HitCountTarget | 获取针对任意类型断点的命中次数。根据命中次数类型的不同,它有不同的解释。 | |
HitCountType | (继承自 Breakpoint。) | |
HitCountType | 获取命中次数类型,它描述如何解释命中次数。 | |
Language | (继承自 Breakpoint。) | |
Language | 获取包含断点的编程语言的名称。 | |
LocationType | (继承自 Breakpoint。) | |
LocationType | 获取断点表示的位置类型。 | |
Macro | 获取或设置断点宏。 | |
Message | 获取或设置断点消息。 | |
Name | (继承自 Breakpoint。) | |
Name | 设置或返回断点的名称。 | |
Parent | (继承自 Breakpoint。) | |
Parent | 获取断点的直接父对象。 | |
Process | 获取与当前断点相关联的 Process2。 | |
Program | (继承自 Breakpoint。) | |
Program | 获取正由此进程管理的可执行文件。 | |
Tag | (继承自 Breakpoint。) | |
Tag | 设置或获取标识此断点的用户定义字符串。 | |
Type | (继承自 Breakpoint。) | |
Type | 获取指定断点类型的常数。 |
页首
方法
名称 | 说明 | |
---|---|---|
Delete() | (继承自 Breakpoint。) | |
Delete() | 删除断点。 | |
ResetHitCount() | (继承自 Breakpoint。) | |
ResetHitCount() | 重置断点命中次数。 |
页首
示例
下面的示例演示如何使用 Breakpoint2 对象的 Children 属性。
测试此属性:
在目标应用程序中设置一个断点。
运行外接程序。
断点子级的号码为零。
以调试模式运行目标应用程序。
当程序停在该断点处时,运行外接程序。
子级号码为一。
public static void Children(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("Children Property
Test");
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("Number of children: " +
debugger.Breakpoints.Item(1).Children.Count.ToString());
}