Condividi tramite


Proprietà StackFrames.Count

Ottiene un valore che indica il numero di oggetti nella raccolta.

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

Sintassi

'Dichiarazione
ReadOnly Property Count As Integer
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int with get
function get Count () : int

Valore proprietà

Tipo: Int32
Valore integer che indica il numero di oggetti nella raccolta StackFrames.

Esempi

Nell'esempio seguente viene illustrato l'utilizzare della proprietà Count.

Per verificare la proprietà:

  1. Nell'applicazione di destinazione, impostare un punto di interruzione all'interno di un metodo diverso da Main().

  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 StackFramesCount(DTE dte)
{
    EnvDTE.StackFrames stackFrames = dte.Debugger.CurrentThread.StackFrames;
    MessageBox.Show("\nThere are  " + stackFrames.Count + 
                    " stack frames.\n", "Stack Frames Count Property Test" );
}
Shared Sub StackFramesCount(ByRef dte As EnvDTE.DTE)
    Dim stackFrames As EnvDTE.StackFrames = dte.Debugger.CurrentThread.StackFrames
    MessageBox.Show("There are " + stackFrames.Count.ToString() + _
                    " stack frames.", "Stack Frame Test - Count Property")
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