Breakpoint.LocationType Property

Indicates the location type this breakpoint represents.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

dbgBreakpointLocationType LocationType { get; }

A Breakpoint can be set in a function, a file, a variable, or at a specific memory address.

The following example demonstrates how to use the LocationType property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Set various breakpoint properties in Properties/Hit Count Dialog Box.

  3. Run the add-in.

public static void LocationType(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("LocationType Property Test: ");

    // 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("HitCountTarget: " + 
    owp.OutputString("\nHitCountType: " + 
    owp.OutputString("\nLocationType: " + 
    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); 

Community Additions