Threads.Count Property
Gets a value indicating the number of objects in the Threads collection.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
ReadOnly Property Count As Integer
'Usage
Dim instance As Threads
Dim value As Integer
value = instance.Count
int Count { get; }
property int Count {
int get ();
}
function get Count () : int
Property Value
Type: System.Int32
An integer value indicating the number of objects in the Threads collection.
Examples
The following example demonstrates how to use the Count property.
To test this property:
Set the breakpoint inside the worker thread callback method.
Run the target application in the debug mode.
When the application stops on the breakpoint, run the add-in.
public static void ThreadsCount(DTE dte)
{
EnvDTE.Threads threads = dte.Debugger.CurrentProgram.Threads;
EnvDTE.StackFrames stackFrames = dte.Debugger.CurrentThread.StackFrames;
MessageBox.Show("\nThere are " + threads.Count +
" threads running.\n", "Threads Count Property Test" );
}
Shared Sub ThreadsCount(ByRef dte As EnvDTE.DTE)
Dim threads As EnvDTE.Threads = dte.Debugger.CurrentProgram.Threads
MessageBox.Show("There are " + threads.Count.ToString() + _
" threads running", "Threads Test - Count Property")
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