مشاركة عبر


Breakpoint.FileLine الخاصية

يشير إلى الموقع السطر داخل ملف بحثاً نقطة توقف.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
ReadOnly Property FileLine As Integer
    Get
int FileLine { get; }
property int FileLine {
    int get ();
}
abstract FileLine : int
function get FileLine () : int

قيمة الخاصية

النوع: System.Int32
عدد صحيح يمثل رقم السطر في تعليمات برمجية المصدر، التي تقاس من يبدأ دالة، تعيين نقطة الإيقاف.

ملاحظات

إذا كانت القيمة الإرجاع هي 1، يتم تعيين نقطة الإيقاف تلك في البداية ملف. هذا هو محدد في الصندوق سطر من الملف، "نقاط الفصل جديد" صندوق حوار.

أمثلة

يوضح المثال التالي كيفية إلى تستخدم في FileLineخاصية.

إلى اختبار هذه خاصية:

  1. قم بتعيين نقطة توقف في تطبيق الهدف.

  2. تشغيل إضافة-في.

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);
}
Shared Sub FileLine(ByRef dte As EnvDTE.DTE)
    Dim strFile As String
    Dim strFileLine As String
    Dim strFileColumn As String
    Dim strEnabled As String
    Dim boolEnabled As Boolean

    dte.Debugger.StepInto(True)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
    strFile = dte.Debugger.Breakpoints.Item(1).File.ToString()
    strFileLine = dte.Debugger.Breakpoints.Item(1).FileLine.ToString()
    strFileColumn = dte.Debugger.Breakpoints.Item(1).FileColumn.ToString()
    boolEnabled = dte.Debugger.Breakpoints.Item(1).Enabled
    If boolEnabled = True Then
        strEnabled = "enabled"
    Else
        strEnabled = "disabled"
    End If

    MessageBox.Show("Breakpoint in the file " + strFile + vbCrLf + _
                    "on line " + strFileLine + " column " + strFileColumn + _
                    " is " + strEnabled + ".")
End Sub

أمن NET Framework.

راجع أيضًَا

المرجع

Breakpoint واجهة

Breakpoint الأعضاء

EnvDTE مساحة الاسم