Share via


Breakpoint.Enabled 속성

Breakpoint 개체의 활성화 상태를 가져오거나 설정합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.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
T:EnvDTE.Breakpoint 개체를 사용할 수 있는지 여부를 나타내는 부울 값입니다.

설명

중단점을 사용할 수 있으면 true를 반환하고 그렇지 않으면 false를 나타냅니다.

예제

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

이 속성을 테스트하려면

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

  2. 추가 기능을 실행합니다. 중단점 상태가 활성입니다.

  3. 마우스 오른쪽 단추를 클릭하여 중단점을 해제합니다.

  4. 추가 기능을 실행합니다. 중단점 상태가 비활성입니다.

public static void Enabled(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("Enabled 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 Enabled(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 네임스페이스

기타 리소스

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