다음을 통해 공유


Breakpoint2.File 속성

중단점이 포함된 파일의 이름을 가져옵니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
ReadOnly Property File As String
    Get
string File { get; }
property String^ File {
    String^ get ();
}
abstract File : string
function get File () : String

속성 값

형식: System.String
중단점이 포함된 파일의 이름이 들어 있는 문자열입니다.

구현

Breakpoint.File

예제

다음 예제에서는 File 속성의 사용 방법을 보여 줍니다.

이 속성을 테스트하려면

  1. 대상 응용 프로그램에 중단점을 설정합니다.

  2. 추가 기능을 실행합니다.

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

    // dte is a reference to the DTE2 object passed to you by the
    // OnConnection method that you implement when you create an Add-in.
    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);
}
Sub FileExample(ByVal dte As DTE2)

    ' NOTE: This example requires a reference to the 
    '       System.Collections namespace.

    ' Before running this example, open a project.
    Dim list As New SortedList()
    Dim brk As Breakpoint
    For Each brk In dte.Debugger.Breakpoints
        If brk.Enabled Then
            list(brk.File) = brk.File
        End If
    Next

    Dim file As DictionaryEntry
    Dim files As String
    For Each file In list
        files &= file.Value.ToString() & vbCrLf
    Next

    MsgBox("The following files have active breakpoints:" & _
        vbCrLf & vbCrLf & files)

End Sub

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Breakpoint2 인터페이스

File 오버로드

EnvDTE80 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행