Threads.Item メソッド

更新 : 2007 年 11 月

Threads コレクション内の Thread オブジェクトを返します。

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

構文

'宣言
Function Item ( _
    index As Object _
) As Thread
'使用
Dim instance As Threads
Dim index As Object
Dim returnValue As Thread

returnValue = instance(index)
Thread Item(
    Object index
)
Thread^ Item(
    [InAttribute] Object^ index
)
function Item(
    index : Object
) : Thread

パラメータ

戻り値

型 : EnvDTE.Thread

Thread オブジェクト。

解説

Item メソッドは、コレクションがインデックス値に対応するオブジェクトを見つけられない場合に System.ArgumentException 例外をスローします。

Item メソッドの使用方法を次の例に示します。

このメソッドをテストするには

  1. ワーカー スレッドのコールバック メソッド内にブレークポイントを設定します。

  2. ターゲット アプリケーションをデバッグ モードで実行します。

  3. ブレークポイントでアプリケーションが停止したら、アドインを実行します。

public static void ThreadsItem(DTE dte)
{
    EnvDTE.Threads threads = dte.Debugger.CurrentProgram.Threads;
    MessageBox.Show("\nThe thread name: " + 
                    threads.Item(2).Name, "Testing Threads Item Method");
}
Shared Sub ThreadsItem(ByRef dte As EnvDTE.DTE)
    Dim threads As EnvDTE.Threads = dte.Debugger.CurrentProgram.Threads
    MessageBox.Show("The thread name: " + threads.Item(2).Name, _
                    "Threads Test - Item Method")
End Sub

アクセス許可

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

参照

参照

Threads インターフェイス

Threads メンバ

EnvDTE 名前空間

その他の技術情報

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