Breakpoint2.FileLine 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取文件中设置断点的行。
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
属性值
包含可在其中设置断点的源代码行数的整数。
实现
- 属性
示例
下面的示例演示如何使用 FileLine 属性。
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);
}
注解
源代码行号从设置断点的函数的开头开始测量。 如果此值为1,则在文件的开头设置断点。 此值在 "文件"、"新建断点" 对话框的 行 框中指定。