Share via


Threads.Item(Object) Method

Definition

Returns a Thread object in a Threads collection.

public:
 EnvDTE::Thread ^ Item(System::Object ^ index);
public:
 EnvDTE::Thread ^ Item(Platform::Object ^ index);
EnvDTE::Thread Item(winrt::Windows::Foundation::IInspectable const & index);
[System.Runtime.InteropServices.DispId(0)]
public EnvDTE.Thread Item (object index);
[<System.Runtime.InteropServices.DispId(0)>]
abstract member Item : obj -> EnvDTE.Thread
Public Function Item (index As Object) As Thread

Parameters

index
Object

Required. The index of the Thread object to return.

Returns

A Thread object.

Attributes

Examples

The following example demonstrates how to use the Item method.

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  

Remarks

The Item method throws a System.ArgumentException exception if the collection cannot find the object that corresponds to the index value.

Applies to