Table of Contents

Class Threads

Namespace
Alternet.Scripter.Debugger.UI
Assembly
Alternet.Scripter.Debugger.UI.v9.dll

Displays list of active threads during script debugging.

[ToolboxBitmap(typeof(Threads), "Images.Threads.Icon.bmp")]
public class Threads : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Inheritance
Threads
Implements

Examples

Here is how to declare a Threads and handle its events from the C# code:

using Alternet.Scripter.Debugger;
using Alternet.Scripter.Debugger.UI;

public partial class Form1 : Form
{
    private void Form1_Load(object sender, EventArgs e)
    {
        var debugger = new ScriptDebugger();
        var threadsControl = new Threads();
        threadsControl.Dock = System.Windows.Forms.DockStyle.Fill;
        threadsControl.Debugger = debugger;
        threadsControl.ThreadClick += ThreadsControl_ThreadClick;
    }

    private void ThreadsControl_ThreadClick(object sender, ThreadClickEventArgs e)
    {
        if (e.Thread != null)
        {
            System.Windows.Forms.MessageBox.Show(e.Thread.Title);
        }
    }
}

Here is how to declare a Threads and handle its events from the Visual Basic code:

Imports System
Imports Alternet.Scripter.Debugger
Imports Alternet.Scripter.Debugger.UI

Partial Public Class Form1
    Inherits Form
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim debugger = New ScriptDebugger()
        Dim threadsControl = New Threads()
        threadsControl.Dock = Windows.Forms.DockStyle.Fill
        threadsControl.Debugger = debugger
        AddHandler threadsControl.ThreadClick, AddressOf ThreadsControl_ThreadClick
    End Sub

    Private Sub ThreadsControl_ThreadClick(ByVal sender As Object, ByVal e As ThreadClickEventArgs)
        If e.Thread IsNot Nothing Then
            Windows.Forms.MessageBox.Show(e.Thread.Title)
        End If
    End Sub
End Class

Remarks

Threads is a visual control to display active threads and switch script debugging between them.

The most important properties of the Threads are:

The Debugger property specifies a ScriptDebugger instance, which threads are displayed by this user under the Threads control.

The SelectedThread property represents the currently selected thread.

Constructors

Threads()

Initializes a new instance of the Threads class with default settings.

Fields

lvThreads

Properties

Debugger

Gets or sets IScriptDebuggerBase which threads will be displayed by this user control.

SelectedThread

Gets a currently selected thread.

Methods

Dispose(bool)

Clean up any resources being used.

Localize()

Localizes string resources.

SetThreads(ThreadInfo[])

Sets threads to be displayed.

Events

ThreadClick

When implemented by a class, occurs when a user clicks on the thread in the list.