Breakpoint.Enabled プロパティ
更新 : 2007 年 11 月
この Breakpoint オブジェクトの有効状態を設定または取得します。
名前空間 : EnvDTE
アセンブリ : EnvDTE (EnvDTE.dll 内)
構文
'宣言
Property Enabled As Boolean
'使用
Dim instance As Breakpoint
Dim value As Boolean
value = instance.Enabled
instance.Enabled = value
bool Enabled { get; set; }
property bool Enabled {
bool get ();
void set (bool value);
}
function get Enabled () : boolean
function set Enabled (value : boolean)
プロパティ値
型 : System.Boolean
この T:EnvDTE.Breakpoint オブジェクトが有効かどうかを表すブール値。
解説
ブレークポイントが有効な場合は true を返し、それ以外の場合は false を返します。
例
Enabled プロパティの使用方法を次の例に示します。
このプロパティをテストするには
ターゲット アプリケーションにブレークポイントを設定します。
アドインを実行します。ブレークポイントの状態は有効です。
マウスを右クリックし、ブレークポイントを無効にします。
アドインを実行します。ブレークポイントの状態は無効です。
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
アクセス許可
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。