Threads.Item Method
Returns a Thread object in a Threads collection.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Function Item ( _
index As Object _
) As Thread
Thread Item(
Object index
)
Thread^ Item(
[InAttribute] Object^ index
)
abstract Item :
index:Object -> Thread
function Item(
index : Object
) : Thread
Parameters
- index
Type: System.Object
Required. The index of the Thread object to return.
Return Value
Type: EnvDTE.Thread
A Thread object.
Remarks
The Item method throws a System.ArgumentException exception if the collection cannot find the object that corresponds to the index value.
Examples
The following example demonstrates how to use the Item method.
To test this method:
Set the breakpoint inside the worker thread callback method.
Run the target application in the debug mode.
When the application stops on the breakpoint, run the add-in.
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
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Other Resources
How to: Compile and Run the Automation Object Model Code Examples