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
index
Type: System.ObjectRequired. The index of the StackFrame object to return.
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:
Set a breakpoint in your target application.
Run the target application in the debug mode.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Other Resources
How to: Compile and Run the Automation Object Model Code Examples