Metodo Threads.Item

Restituisce un oggetto Thread di un insieme Threads.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
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

Parametri

  • index
    Tipo: System.Object
    Obbligatorio.Indice dell'oggetto Thread che deve essere restituito.

Valore restituito

Tipo: EnvDTE.Thread
Oggetto Thread.

Note

Il metodo Item genera un'eccezione System.ArgumentException se l'insieme non riesce a trovare l'oggetto che corrisponde al valore di indice.

Esempi

Nell'esempio riportato di seguito viene illustrato come utilizzare il metodo Item.

Per verificare il metodo:

  1. Impostare il punto di interruzione all'interno del metodo di callback dei thread di lavoro.

  2. Eseguire l'applicazione di destinazione in modalità debug.

  3. Quando l'applicazione si interrompe al punto di interruzione, eseguire il componente aggiuntivo.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Threads Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione