Condividi tramite


Metodo StackFrames.Item

Restituisce un oggetto StackFrame oggetto in StackFrames raccolta.

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

Sintassi

'Dichiarazione
Function Item ( _
    index As Object _
) As StackFrame
StackFrame Item(
    Object index
)
StackFrame^ Item(
    [InAttribute] Object^ index
)
abstract Item : 
        index:Object -> StackFrame 
function Item(
    index : Object
) : StackFrame

Parametri

Valore restituito

Tipo: EnvDTE.StackFrame
In StackFrame oggetto.

Note

Item il metodo genera un'eccezione ArgumentException eccezione se la raccolta impossibile trovare l'oggetto che corrisponde al valore di indice.

Esempi

Nell'esempio seguente viene illustrato come utilizzare Item metodo.

Per testare questo metodo:

  1. Impostare un punto di interruzione nell'applicazione di destinazione.

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

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

public static void StackFramesItem(DTE dte)
{
    EnvDTE.StackFrames stackFrames = dte.Debugger.CurrentThread.StackFrames;
    MessageBox.Show("\nThe stack frame function name: " + 
                    stackFrames.Item(1).FunctionName, 
                    "Stack Frames Item Method Test");
}
Shared Sub StackFramesItem(ByRef dte As EnvDTE.DTE)
    Dim stackFrames As EnvDTE.StackFrames = dte.Debugger.CurrentThread.StackFrames
    MessageBox.Show("The stack frame function name: " + _
                    stackFrames.Item(1).FunctionName, _
                    "Stack Frame Test - Item Method")
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

StackFrames Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

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