Table of Contents

Class Errors

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

Interaction logic for Errors.xaml

public class Errors : UserControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged, IUpdate
Inheritance
Errors
Implements
Extension Methods

Examples

Here is how to declare a Errors and handle its events 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 errorsControl = new Errors();
        errorsControl.Debugger = debugger;
        errorsControl.ErrorClick += ErrorsControl_ErrorClick;
    }

    private void ErrorsControl_ErrorClick(object sender, ErrorClickEventArgs e)
    {
        MessageBox.Show(e.Error.Message);
    }
}

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

Imports System
Imports System.Diagnostics
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 errorsControl = New Errors()
        errorsControl.Debugger = debugger
        AddHandler errorsControl.ErrorClick, AddressOf ErrorsControl_ErrorClick
    End Sub

    Private Sub ErrorsControl_ErrorClick(ByVal sender As Object, ByVal e As ErrorClickEventArgs)
        MessageBox.Show(e.Error.Message)
    End Sub
End Class

Remarks

Errors is a visual control that displays a list of compilation errors when compiling the script.

The most important properties of the Errors are:

The Debugger property defines the ScriptDebugger instance, which compilation errors are displayed by the Errors control.

The SelectedError property represents the currently selected syntax error.

Constructors

Errors()

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

Fields

errors
showErrors
showWarnings
source

Properties

Debugger

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

SelectedError

Gets currently selected error.

UpdateCount

When implemented by a class, keeps track of calls to BeginUpdate and EndUpdate so that they can be nested.

Methods

AddCompilerError(ScriptCompilationDiagnostic)

Adds specified error to the error's collection.

AddCompilerErrors(ScriptCompilationDiagnostic[])

Adds specified errors to the error's collection.

BeginUpdate()

Prevents updating until calling EndUpdate method.

Clear()

Clears error list.

DisableUpdate()

Prevents updating until calling EnableUpdate method.

EnableUpdate()

Re-enables object state updating, that was turn of by calling DisableUpdate method. Using DisableUpdate/EnableUpdate to prevent notifying about updating the object state.

EndUpdate()

Re-enables updating, that was turn of by calling BeginUpdate method.

GetImageName(ScriptCompilationDiagnosticKind)
Localize()
RaisePropertyChanged(string)
Reset()

Resets user control to it's default state.

Update()

When implemented by a class, updates an object state.

Events

ErrorClick

Occurs when given process receives variables.

PropertyChanged

Occurs when a property value changes.