共用方式為


Breakpoint.FileColumn 屬性

指出檔案中斷點在檔案中某一行內的字元位置。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property FileColumn As Integer
int FileColumn { get; }
property int FileColumn {
    int get ();
}
abstract FileColumn : int
function get FileColumn () : int

屬性值

型別:System.Int32
表示檔案中某一行之字元位置的整數,而這個檔案包含了這個中斷點。

備註

這個傳回值是在 [新增中斷點、檔案] 對話方塊內的 [字元] 方塊中進行指定。

範例

下列範例示範如何使用 FileColumn 屬性。

若要測試這個屬性:

  1. 請在目標應用程式中設定中斷點。

  2. 執行增益集。

public static void FileColumn(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("FileColumn 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 FileColumn(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 介面

EnvDTE 命名空間