You can add a link to Microsoft Script Control and start using JavaScript to check your status. Here is a simple example
[System.Runtime.InteropServices.ComVisible(true)] public partial class Form1 : Form { [System.Runtime.InteropServices.ComVisible(true)] public class Person { public int Status = 9; } public Person person = new Person(); private void Form1_Load(object sender, EventArgs e) { MSScriptControl.ScriptControlClass script = new MSScriptControl.ScriptControlClass(); script.Language = "JavaScript"; script.AddObject("myform", this,true); var b = script.Eval("myform.person.Status==9"); } }
To avoid re-adding [System.Runtime.InteropServices.ComVisible(true)] you can change the line in AssemblyInfo.cs from [assembly: ComVisible(false)] to [assembly: ComVisible(true)]
source share