StackFrame.Collection Property

Definition

Gets the collection that contains the object that supports this property or is contained in this code construct. Returns null for an object that is not obtained from a collection.

public:
 property EnvDTE::StackFrames ^ Collection { EnvDTE::StackFrames ^ get(); };

Property Value

A StackFrames collection.

Attributes

Examples

The following example demonstrates how to use the Collection property.

public static void TestStackFrames(DTE dte)  
{  
    // Setup debug Output window.  
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);  
    w.Visible = true;  
    OutputWindow ow = (OutputWindow)w.Object;  
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Stack Frames Test");  
    owp.Activate();  

    EnvDTE.StackFrames stackFrames = dte.Debugger.CurrentThread.StackFrames;  
    owp.OutputString("\nNumber of items in the Current Stack collection: " +   
                     stackFrames.Item(1).Collection.Count + "\n");  

    foreach(EnvDTE.StackFrame sf in stackFrames)  
    {  
        owp.OutputString("\nStack Frame: " + sf.FunctionName);  
        owp.OutputString("\n  Edition of the environment : " + sf.DTE.Edition);  
        owp.OutputString("\n  Language                   : " + sf.Language);  
        owp.OutputString("\n  Locals");  
        EnvDTE.Expressions expressions = sf.Locals;  
        foreach(EnvDTE.Expression exp in expressions)  
            owp.OutputString("\n    " + exp.Name + " = " + exp.Value);  
        owp.OutputString("\n  Module                     : " + sf.Module);  
        owp.OutputString("\n  Current Thread ID          : " + sf.Parent.ID);  
        owp.OutputString("\n  Return Type                : " + sf.ReturnType);  
    }  
}  

Applies to