Export (0) Print
Expand All

Breakpoint.FileLine Property

Indicates the line location within a file for a breakpoint.

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

int FileLine { get; }
/** @property */
int get_FileLine ()

function get FileLine () : int

Property Value

An integer that represents the line number in the source code, measured from the start of the function, at which the breakpoint is set.

If the return value is 1, the breakpoint is set at the start of the file. This is specified in the Line box of the File, New Breakpoint dialog box.

The following example demonstrates how to use the FileLine property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the add-in.

public static void FileLine(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("FileLine Property Test: ");
    owp.Activate();

    // 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("Breakpoint in the file " + debugger.Breakpoints.Item(1).File);
    owp.OutputString(" on line " + 
                     debugger.Breakpoints.Item(1).FileLine.ToString() + " column ");
    owp.OutputString(debugger.Breakpoints.Item(1).FileColumn.ToString() + " is ");
    owp.OutputString(debugger.Breakpoints.Item(1).Enabled ? "enabled." : "disabled.");
    owp.OutputString("\nThis breakpoint is in the function: " + 
                     debugger.Breakpoints.Item(1).FunctionName);
}

Community Additions

ADD
Show:
© 2015 Microsoft