다음을 통해 공유


Breakpoint2.Enabled 속성

중단점의 활성화 상태를 설정하거나 반환합니다.

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

구문

‘선언
Property Enabled As Boolean
bool Enabled { get; set; }
property bool Enabled {
    bool get ();
    void set (bool value);
}
abstract Enabled : bool with get, set
function get Enabled () : boolean 
function set Enabled (value : boolean)

속성 값

형식: Boolean
중단점이 활성화되어 있으면 부울 값이 true이고, 그렇지 않으면 false입니다.

예제

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

이 속성을 테스트하려면

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

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

    중단점 상태가 활성입니다.

  3. 마우스 오른쪽 단추를 클릭하여 중단점을 비활성화합니다.

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

    중단점 상태가 비활성입니다.

public static void Enabled(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("Enabled 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 EnabledSamplesVB(ByVal dte As DTE2)

    If MsgBox("Disable all breakpoints?", MsgBoxStyle.YesNo) _
        = MsgBoxResult.Yes Then
        Dim bp As Breakpoint
        For Each bp In dte.Debugger.Breakpoints
            bp.Enabled = False
        Next
    End If

End Sub

.NET Framework 보안

참고 항목

참조

Breakpoint2 인터페이스

EnvDTE80 네임스페이스

기타 리소스

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