Property IsStarted
IsStarted
Indicates whether debugging was started.
public bool IsStarted { get; }
Property Value
Examples
Here is how to use a IsStarted in the C# code:
using System;
using System.Threading.Tasks;
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,
};
}
protected override void OnClosed(EventArgs e)
{
if (Debugger.IsStarted)
Task.Run(async () => await Debugger.StopDebuggingAsync()).Wait();
base.OnClosed(e);
Debugger.ClearTemporaryGeneratedModules();
}
}
Here is how to use a IsStarted in the Visual Basic code:
Imports System
Imports System.Threading.Tasks
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
}
End Sub
Protected Overrides Sub OnClosed(ByVal e As EventArgs)
If debugger.IsStarted Then debugger.StopDebuggingAsync()
MyBase.OnClosed(e)
debugger.ClearTemporaryGeneratedModules()
End Sub
End Class
Remarks
Use ScriptRun properties to set script properties to be debugged, such as script language or collection of script source files.