Compartir a través de


StackFrames.Item Method

Returns a StackFrame object in a StackFrames collection.

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

Syntax

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

Parameters

Return Value

Type: EnvDTE.StackFrame
A StackFrame object.

Remarks

The Item method throws a ArgumentException exception if the collection cannot find the object that corresponds to the index value.

Examples

The following example demonstrates how to use the Item method.

To test this method:

  1. Set a breakpoint in your target application.

  2. Run the target application in the debug mode.

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

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

.NET Framework Security

See Also

Reference

StackFrames Interface

EnvDTE Namespace

Other Resources

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