StackFrames.Item 方法

返回 StackFrames 集合中的一个 StackFrame 对象。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

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

参数

返回值

类型:EnvDTE.StackFrame
一个 StackFrame 对象。

备注

如果集合找不到对应于索引值的对象,则 Item 方法引发 ArgumentException 异常。

示例

下面的示例演示如何使用 Item 方法。

若要测试此方法,请执行下列操作:

  1. 在目标应用程序中设置一个断点。

  2. 以调试模式运行目标应用程序。

  3. 当应用程序停在该断点处时,运行外接程序。

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 安全性

请参见

参考

StackFrames 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例