Table of Contents

Property Debugger

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

Debugger

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

public IScriptDebuggerBase Debugger { get; set; }

Property Value

IScriptDebuggerBase

Examples

Here is how to use a Debugger in 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 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 use a Debugger in the Visual Basic code:

Imports System

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 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 UI control is a quick access panel to all debugger commands. You can associate the Debugger with the DebuggerControlToolbar control by setting Debugger property.