Table of Contents

Property SelectedError

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

SelectedError

Gets currently selected error.

public ScriptCompilationDiagnostic SelectedError { get; }

Property Value

ScriptCompilationDiagnostic

Examples

Here is how to use a SelectedError 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 errorsControl = new Errors();
        errorsControl.Debugger = debugger;
    }


    private void Button_Click(object sender, RoutedEventArgs e)
    {
        var error = errorsControl.SelectedError;
        MessageBox.Show(string.Format("file: {0} line: {1} Message: {2}", error.FileName, error.Line, error.Message));
    }
}

Here is how to use a SelectedError in 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
    End Sub


    Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim error As Alternet.Scripter.ScriptCompilationDiagnostic = errorsControl.SelectedError
        MessageBox.Show(String.Format("file: {0} line: {1} Message: {2}", error.FileName, error.Line, error.Message))
    End Sub
End Class

Remarks

The SelectedError property can be changed by clicking on the appropriate error\warning in the ScriptCompilationDiagnostic list displayed by this control.