Class DebugMenu
Represents a collection of the menu items used to execute debugger-related commands.
public class DebugMenu : ToolStripMenuItem, IDropTarget, IComponent, IDisposable
- Inheritance
-
DebugMenu
- Implements
Examples
Here is how to declare a DebugMenu 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 debugMenu = new DebugMenu();
debugMenu.Debugger = debugger;
debugMenu.DebuggerPreStartup += OnDebuggerPreStartup;
}
private void OnDebuggerPreStartup(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox.Show("Debugger is about to start");
}
}
Here is how to declare a DebugMenu 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 debugMenu = New DebugMenu()
debugMenu.Debugger = debugger
AddHandler debugMenu.DebuggerPreStartup, AddressOf OnDebuggerPreStartup
End Sub
Private Sub OnDebuggerPreStartup(ByVal sender As Object, ByVal e As EventArgs)
Windows.Forms.MessageBox.Show("Debugger is about to start")
End Sub
End Class
Remarks
DebugMenu contains a collection of menu items that represent commonly used debugging commands like step-by-step execution, stopping on breakpoints, examining local variables, expression evaluations, etc.
The most important properties of the DebugMenu are:
The Debugger property specifies the ScriptDebugger instance, which commands are executed by this control.
The AllowedDebuggerCommands property represents a set of commands displayed by this menu.
The CommandsListener property represents an object that allows custom handling for all commands executed via this menu.
Constructors
- DebugMenu()
Initializes a new instance of the
DebugMenu
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 displayed by this control.
- DefaultCommands
Gets
IDebuggerUICommands
processed by this menu.
Methods
- Localize()
Localizes string resources.
- ShouldSerializeAllowedDebuggerCommands()
Indicates whether the
AllowedDebuggerCommands
property should be persisted.
- UpdateShortcut(string, Keys)
Updates shortcut associated with a particular menu item.
Events
- DebuggerPreStartup
Occurs when the execution of a program is started.