Breakpoint2.LocationType 属性

获取断点表示的位置类型。

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

语法

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

属性值

类型:EnvDTE.dbgBreakpointLocationType
dbgBreakpointLocationType 值之一。

实现

Breakpoint.LocationType

备注

可以在函数、文件、变量或特定内存地址中设置断点。 有关更多信息,请参见 断点与跟踪点

示例

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

测试此属性:

  1. 在目标应用程序中设置一个断点。

  2. 在“属性”->“命中次数”对话框中设置不同的断点属性。

  3. 运行外接程序。

public static void LocationType(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("LocationType 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 接口

LocationType 重载

EnvDTE80 命名空间

其他资源

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