Thread2.Flag Thread2.Flag Thread2.Flag Thread2.Flag Thread2.Flag Property

Definition

Gets or sets a flag on an individual thread.

public:
 property bool Flag { bool get(); void set(bool value); };
public:
 property bool Flag { bool get(); void set(bool value); };
[System.Runtime.InteropServices.DispId(2100)]
[get: System.Runtime.InteropServices.DispId(2100)]
[set: System.Runtime.InteropServices.DispId(2100)]
public bool Flag { get; set; }
member this.Flag : bool with get, set
Public Property Flag As Boolean
Property Value

A boolean value representing whether a flag is set on a thread; true if there is, false otherwise.

Examples

The following example demonstrates how to use the Collection property.

public static void TestThreadProperties(DTE2 dte)  
{  
    // Setup debug Output window.  
    Window w =   
      (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);  
    w.Visible = true;  
    OutputWindow ow = (OutputWindow)w.Object;  
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Thread Test");  
    owp.Activate();  

    EnvDTE.Threads threads = dte.Debugger.CurrentProgram.Threads;  
    owp.OutputString("
Number of items in the Thread collection: " + threads.Item(1).Collection.Count + "
"); foreach(EnvDTE90.Thread2 thread in threads) { owp.OutputString("
Thread: " + thread.ID + " Name: " + thread.Name); owp.OutputString("
Edition of the environment : " + thread.DTE.Edition); owp.OutputString("
Is alive : " + thread.IsAlive); owp.OutputString("
Is frozen : " + thread.IsFrozen); owp.OutputString("
Location : " + thread.Location); owp.OutputString("
Parent's current mode : " + thread.Parent.CurrentMode); owp.OutputString("
Priority : " + thread.Priority); owp.OutputString("
Program name : " + thread.Program.Name); owp.OutputString("
Number of stack frames : " + thread.StackFrames.Count); owp.OutputString("
Suspended number of times : " + thread.SuspendCount); owp.OutputString("
Flag on the thread : " + thread.Flag); } }
Shared Sub ThreadProperties(ByRef dte As EnvDTE80.DTE2)  
    Dim str As String  
    Dim threads As EnvDTE.Threads = dte.Debugger.CurrentProgram.Threads  
    str = "Number of items in the Thread collection: " + _  
      threads.Item(1).Collection.Count.ToString()  
    For Each thread As EnvDTE90.Thread2 In threads  
        str += vbCrLf + vbCrLf + "  Thread: " + thread.ID.ToString()  
        str += vbCrLf + "    Edition of the environment: " +   
          thread.DTE.Edition  
        str += vbCrLf + "    Is alive: " + thread.IsAlive.ToString()  
        str += vbCrLf + "    Is frozen: " + thread.IsFrozen.ToString()  
        str += vbCrLf + "    Location: " + thread.Location  
        str += vbCrLf + "    Parent's current mode: " + _  
               thread.Parent.CurrentMode.ToString()  
        str += vbCrLf + "    Priority: " + thread.Priority  
        str += vbCrLf + "    Program name: " + thread.Program.Name  
        str += vbCrLf + "    Number of stack frames: " + _  
               thread.StackFrames.Count.ToString()  
        str += vbCrLf + "    Suspended number of times: " + _  
               thread.SuspendCount.ToString()  
        str += vbCrLf + "    Flag on the thread: " + _  
               thread.Flag.ToString()  
    Next  
    MessageBox.Show(str, "Thread Test - Properties")  
End Sub  

Applies to