Partager via


Breakpoint2.FileLine Property

Definition

Gets the line within a file where the breakpoint is set.

public:
 property int FileLine { int get(); };
public:
 property int FileLine { int get(); };
[System.Runtime.InteropServices.DispId(106)]
public int FileLine { [System.Runtime.InteropServices.DispId(106)] get; }
[<System.Runtime.InteropServices.DispId(106)>]
[<get: System.Runtime.InteropServices.DispId(106)>]
member this.FileLine : int
Public ReadOnly Property FileLine As Integer

Property Value

An integer containing the source-code line number at which the breakpoint is set.

Implements

Attributes

Examples

The following example demonstrates how to use the FileLine property.

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

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)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);  
}  

Remarks

The source-code line number is measured from the start of the function at which the breakpoint is set. If this value is 1, the breakpoint is set at the start of the file. This value is specified in the Line box of the File, New Breakpoint dialog box.

Applies to