Class DebuggerControlToolbar
Represents a ToolStrip
that contains items used to execute debugger-related commands.
public class DebuggerControlToolbar : ToolStrip, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
- Inheritance
-
DebuggerControlToolbar
- Implements
Examples
Here is how to declare a DebuggerControlToolbar 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 debuggerControlToolbar = new DebuggerControlToolbar();
debuggerControlToolbar.Debugger = debugger;
debuggerControlToolbar.DebuggerPreStartup += DebuggerPreStartup;
}
private void DebuggerPreStartup(object sender, EventArgs e)
{
foreach (var edit in codeEditContainer.Editors)
{
if (edit.Modified)
edit.SaveFile(edit.FileName);
}
}
}
Here is how to declare a DebuggerControlToolbar 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 debuggerControlToolbar = New DebuggerControlToolbar()
debuggerControlToolbar.Debugger = debugger
AddHandler debuggerControlToolbar.DebuggerPreStartup, AddressOf DebuggerPreStartup
End Sub
Private Sub DebuggerPreStartup(ByVal sender As Object, ByVal e As EventArgs)
For Each edit In codeEditContainer.Editors
If edit.Modified Then edit.SaveFile(edit.FileName)
Next
End Sub
End Class
Remarks
DebuggerControlToolbar is a toolbar control that allows executing debugging commands such as Run/Stop/StepInto/StepOver when debugging the script.
The most important properties of the DebuggerControlToolbar are:
The Debugger property specifies ScriptDebugger instance will be executed when the user interacts with the toolbar.
The AllowedDebuggerCommands property represents a set of commands accessible through the toolbar.
Constructors
- DebuggerControlToolbar()
Initializes a new instance of the
DebugToolStrip
class with default settings.
Properties
- AllowedDebuggerCommands
Gets or sets an allowed commands.
- CommandsListener
Gets or sets a list of the Debugger commands for the Debugger UI.
- Debugger
Gets or sets
IScriptDebuggerBase
which commands will be processed by this toolbar.
- DefaultCommands
Gets
IDebuggerUICommands
processed by this toolbar.
Methods
- Localize()
Localizes string resources.
- ShouldSerializeAllowedDebuggerCommands()
Indicates whether the
AllowedDebuggerCommands
property should be persisted.
Events
- DebuggerPreStartup
Occurs when the execution of a program is started.