Breakpoint2.ConditionType 属性

获取断点的条件类型,可以为在条件为真时中断,或在条件更改时中断。

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

语法

声明
ReadOnly Property ConditionType As dbgBreakpointConditionType
    Get
dbgBreakpointConditionType ConditionType { get; }
property dbgBreakpointConditionType ConditionType {
    dbgBreakpointConditionType get ();
}
abstract ConditionType : dbgBreakpointConditionType
function get ConditionType () : dbgBreakpointConditionType

属性值

类型:EnvDTE.dbgBreakpointConditionType
dbgBreakpointConditionType 值之一。

实现

Breakpoint.ConditionType

备注

此类型可以指示是在条件为真时中断还是在条件已更改时中断。

示例

下面的示例演示如何使用 ConditionType 属性。

测试此属性:

  1. 运行外接程序。

  2. 运行目标应用程序。

public static void ConditionType(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("Breakpoint Condition and Type are: ");
    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;
    //Stop at the breakpoint, if TempC < TempF is true
    debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "tempC < tempF",
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue,
                             "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    string strCondition = debugger.Breakpoints.Item(1).Condition;
    string strConditionType = debugger.Breakpoints.Item(1).ConditionType.ToString();
    owp.OutputString(strCondition + "\n" + strConditionType);
}

.NET Framework 安全性

请参见

参考

Breakpoint2 接口

ConditionType 重载

EnvDTE80 命名空间

其他资源

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

如何:指定断点条件