Class DebugMenu
public class DebugMenu : MenuItem, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IContainItemStorage, ICommandSource
- Inheritance
-
DebugMenu
- Implements
- Extension Methods
Examples
Here is how to declare a DebugMenu from the C# code:
using System;
using System.Diagnostics;
using System.Windows;
using Alternet.Scripter.Debugger;
using Alternet.Scripter.Debugger.UI.Wpf;
public partial class MainWindow : Window
{
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var debugger = new ScriptDebugger();
var debugMenu = new DebugMenu();
debugMenu.Debugger = debugger;
debugMenu.DebuggerPreStartup += OnDebuggerPreStartup;
}
private void OnDebuggerPreStartup(object sender, EventArgs e)
{
MessageBox.Show("Debugger is about to start");
}
}
Here is how to declare a DebugMenu from the Visual Basic code:
Imports System
Imports System.Windows
Imports Alternet.Scripter.Debugger
Imports Alternet.Scripter.Debugger.UI.Wpf
Partial Public Class MainWindow
Inherits Window
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim debugger = New ScriptDebugger()
Dim debugMenu = New DebugMenu()
debugMenu.Debugger = debugger
debugMenu.DebuggerPreStartup += AddressOf OnDebuggerPreStartup
End Sub
Private Sub OnDebuggerPreStartup(ByVal sender As Object, ByVal e As EventArgs)
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.
Fields
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 errors will be displayed by this user control.
- DefaultCommands
Gets
IDebuggerUICommands
processed by this menu.