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
function get Count () : int

Valore proprietà

Tipo: System.Int32
Un intero che indica il numero di oggetti in StackFrames raccolta.

Esempi

Nell'esempio seguente viene illustrato come utilizzare Count proprietà.

Per verificare questa proprietà:

  1. Nell'applicazione di destinazione, impostare un punto di interruzione nel metodo diverso dal metodo Main().

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