StackFrames.Count 属性

获取一个值,该值指示集合中对象的数目。

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

语法

声明
ReadOnly Property Count As Integer
    Get
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int
function get Count () : int

属性值

类型:System.Int32
指示 StackFrames 集合中对象数的整数值。

示例

下面的示例演示如何使用 Count 属性。

测试此属性:

  1. 在目标应用程序中,在 Main() 方法以外的方法内部设置一个断点。

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

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

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

请参见

参考

StackFrames 接口

EnvDTE 命名空间

其他资源

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