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
パラメータ
- index
型 : System.Object
戻り値
型 : EnvDTE.Thread
Thread オブジェクト。
解説
Item メソッドは、コレクションがインデックス値に対応するオブジェクトを見つけられない場合に System.ArgumentException 例外をスローします。
例
Item メソッドの使用方法を次の例に示します。
このメソッドをテストするには
ワーカー スレッドのコールバック メソッド内にブレークポイントを設定します。
ターゲット アプリケーションをデバッグ モードで実行します。
ブレークポイントでアプリケーションが停止したら、アドインを実行します。
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
アクセス許可
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。