Table of Contents

Property ExpressionEvaluator

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

ExpressionEvaluator

Gets IExpressionEvaluator object used to evaluate expressions.

public IExpressionEvaluator ExpressionEvaluator { get; }

Property Value

IExpressionEvaluator

Examples

Here is how to use a ExpressionEvaluator in the C# code:

using Alternet.Scripter;
using Alternet.Scripter.Debugger;

public partial class Form1 : Form
{
    private ScriptRun scriptRun;
    private ScriptDebugger debugger;
    private void Form1_Load(object sender, EventArgs e)
    {
        scriptRun = new ScriptRun();
        scriptRun.ScriptLanguage = ScriptLanguage.CSharp;
        scriptRun.LoadFile("myScript.cs");
        debugger = new ScriptDebugger
        {
            ScriptRun = scriptRun,
        };

        debugger.DebuggerErrorOccured += Debugger_DebuggerErrorOccured;
    }

    private void Debugger_DebuggerErrorOccured(object sender, DebuggerErrorOccuredEventArgs e)
    {
        debugger.ExpressionEvaluator.EvaluateCurrentExceptionAsync();
    }
}

Here is how to use a ExpressionEvaluator in the Visual Basic code:

Imports Alternet.Scripter
Imports Alternet.Scripter.Debugger

Partial Public Class Form1
    Inherits Form

    Private scriptRun As ScriptRun
    Private debugger As ScriptDebugger

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        scriptRun = New ScriptRun()
        scriptRun.ScriptLanguage = ScriptLanguage.CSharp
        scriptRun.LoadFile("myScript.cs")
        debugger = New ScriptDebugger With {
            .scriptRun = scriptRun
        }
        debugger.DebuggerErrorOccured += AddressOf Debugger_DebuggerErrorOccured
    End Sub

    Private Sub Debugger_DebuggerErrorOccured(ByVal sender As Object, ByVal e As DebuggerErrorOccuredEventArgs)
        debugger.ExpressionEvaluator.EvaluateCurrentExceptionAsync()
    End Sub
End Class

Remarks

Expressions can be evaluated by users when debugging the application step by step, or when it�s stopped at a breakpoint. Normally you don�t need to use this class directly, it�s used internally by Locals or Watches user controls or Expression Evaluation dialog.