Property SelectedError
SelectedError
Gets currently selected error.
[Browsable(false)]
public ScriptCompilationDiagnostic SelectedError { get; }
Property Value
Examples
Here is how to use a SelectedError in the C# code:
using System;
using System.Diagnostics;
using Alternet.Scripter.Debugger;
using Alternet.Scripter.Debugger.UI;
public partial class Form1 : Form
{
private Errors errorsControl;
private void Form1_Load(object sender, EventArgs e)
{
var debugger = new ScriptDebugger();
errorsControl = new Errors();
errorsControl.Dock = System.Windows.Forms.DockStyle.Fill;
errorsControl.Debugger = debugger;
}
private void Button_Click(object sender, EventArgs e)
{
var error = errorsControl.SelectedError;
System.Windows.Forms.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 Alternet.Scripter.Debugger
Imports Alternet.Scripter.Debugger.UI
Partial Public Class Form1
Inherits Form
Private errorsControl As Errors
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim debugger = New ScriptDebugger()
errorsControl = New Errors()
errorsControl.Dock = Windows.Forms.DockStyle.Fill
errorsControl.Debugger = debugger
End Sub
Private Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim error As Alternet.Scripter.ScriptCompilationDiagnostic = errorsControl.SelectedError
Windows.Forms.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.