Partager via


StackFrames.Count Property

Gets a value indicating the number of objects in the collection.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

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

Property Value

Type: System.Int32
An integer value indicating the number of objects in the StackFrames collection.

Examples

The following example demonstrates how to use the Count property.

To test this property:

  1. In your target application, set a breakpoint inside the method other than the method Main().

  2. Run the target application in the debug mode.

  3. When the application stops on the breakpoint, run the add-in.

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

.NET Framework Security

See Also

Reference

StackFrames Interface

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples