This topic has not yet been rated - Rate this topic

Debugger3.Breakpoints Property

Gets a collection of breakpoints.

Namespace:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)
Breakpoints Breakpoints { get; }

Property Value

Type: EnvDTE.Breakpoints
A Breakpoints collection.

Implements

Debugger2.Breakpoints

Breakpoints gets the collection of all breakpoints set in the debugger. This collection represents the list of all pending breakpoints. See dbgBreakpointType for a description of pending and bound breakpoints.

The following example shows how to use the Breakpoints property.

To test this property:

  1. Open the target project and run the add-in.

public static void Breakpoints(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("Breakpoints 
    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.
    EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;

    // Set breakpoints.  
    debugger.Breakpoints.Add("","Target001.cs", 13, 1, "", 
        
EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
        "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    debugger.Breakpoints.Add("","Target001.cs", 14, 1, "", 
        
EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
        "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);            

    owp.OutputString("Number of breakpoints set: " + 
                     debugger.Breakpoints.Count + "\n");

    // List all breakpoints.
    foreach(EnvDTE90.Breakpoint3 bp in debugger.Breakpoints)
    {
        owp.OutputString(bp.Name + "\n");
    }
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Advertisement