Metodo StackFrames.Item

Restituisce un oggetto StackFrame all'interno di un insieme StackFrames.

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
Un oggetto StackFrame.

Note

Il metodo Item genera un'eccezione 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 un punto di interruzione nell'applicazione di destinazione.

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

  3. Quando l'applicazione si interrompe in corrispondenza del 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