public void Test21() { try { var code = @" t1 = new TestJitClass "; var jac = new JacInterpreter(); jac.Exec(code); } catch (JacException ex) { Assert.AreEqual(ex.Code, JacException.Codes.TypeNotFound); } try { var code = @" t1 = new TestJitClass "; JacInterpreter.RegisterJacTarget(typeof(TestJitClass).Assembly); var jac = new JacInterpreter(); jac.Exec(code); } catch (JacException) { Assert.Fail(); } }
public override void OnInitialInstance() { UndoButton = (TButton)ControlUtil.FindControl(View, "UndoButton"); RedoButton = (TButton)ControlUtil.FindControl(View, "RedoButton"); if (UndoButton.Foreground is SolidColorBrush scb) { ButtonForegroundColor = scb.Color; } ButtonEnable(UndoButton, false); ButtonEnable(RedoButton, false); JacInterpreter.RegisterJacTarget(typeof(FeatureGuiJacBroker).Assembly); }
public void Test25() { var code = @" Piyo = new TestJitClass ChildValueA = 'abc' "; JacInterpreter.RegisterJacTarget(typeof(TestJitClass).Assembly); var jac = new JacInterpreter(); jac.Exec(code); var Piyo = jac["Piyo"] as TestJitClass; Assert.IsNotNull(Piyo); Assert.IsTrue(Piyo.Contains("ChildValueA")); Assert.AreEqual(Piyo["ChildValueA"], "abc"); code = $@" Piyo.ChildValueB = 'def' "; jac.Exec(code); Assert.IsTrue(Piyo.Contains("ChildValueB")); Assert.AreEqual(Piyo["ChildValueB"], "def"); }