次の方法で共有


Breakpoints.Count プロパティ

Breakpoints コレクションに含まれる Breakpoint オブジェクトの数を示す値を返します。

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)

構文

'宣言
ReadOnly Property Count As Integer
    Get
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int
function get Count () : int

プロパティ値

型: System.Int32
コレクションに含まれる Breakpoint オブジェクトの数を表す整数値。

Count プロパティの使用方法を次の例に示します。

このプロパティをテストするには

public static void Count(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("Count 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;
    debugger.Breakpoints.Add("","Target001.cs", 13, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    debugger.Breakpoints.Add("","Target001.cs", 15, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);

    owp.OutputString("\nNumber of Breakpoints: " + debugger.Breakpoints.Count);
    owp.OutputString("\nEdition of the environment: " + 
                     debugger.Breakpoints.DTE.Edition);
    owp.OutputString("\nParent's Current Mode: " + 
                     debugger.Breakpoints.Parent.CurrentMode);
    owp.OutputString("\nFirst breakpoint is on line " + 
                     debugger.Breakpoints.Item(1).FileLine + ".");
    owp.OutputString("\nSecond breakpoint is on line " + 
                     debugger.Breakpoints.Item(2).FileLine + ".");
}
Shared Sub Count(ByRef dte As EnvDTE.DTE)
    Dim str As String
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 13, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
    str = "Number of Breakpoints: " + dte.Debugger.Breakpoints.Count.ToString() + vbCrLf
    str += "Edition of the environment: " + dte.Debugger.Breakpoints.DTE.Edition + vbCrLf
    str += "Parent's Current Mode: " + dte.Debugger.Breakpoints.Parent.CurrentMode.ToString() + vbCrLf
    str += "First breakpoint is on line " + dte.Debugger.Breakpoints.Item(1).FileLine.ToString() + "." + vbCrLf
    str += "Second breakpoint is on line " + dte.Debugger.Breakpoints.Item(2).FileLine.ToString() + "." + vbCrLf
    MessageBox.Show(str, "Count Property Test")
End Sub

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

Breakpoints インターフェイス

EnvDTE 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する