Example #1
0
        public virtual void OnBeforeTest()
        {
            if (js != null)
                js.Dispose();

            js = new JsEngine();
        }
Example #2
0
        public void Run()
        {
            Debug.Print("Starting up.");

            /// Create the script engine.
            Script = new JsEngine()
                .SetNamedItem("external", _processApi);

            var resPaths = new string[]{
                "Gel.process.js",
                "Gel.os.js",
                "Gel.natives.js",
                "Gel.console.js",
                "Gel.evals.js",
                "Gel.timer_wrap.js"
            };

            foreach (var resPath in resPaths)
            {
                Script.Exec(JsEngine.PreprocessEmbedded(resPath));
            }

            Script.Exec(JsEngine.PreprocessEmbedded("Gel.gel.js"));

            while (needTickCallback)
            {
                _processApi.doTickCallback(null);
            }

            /// TODO: If get main view from script; pass it to Application.Run().

            if (!_exited)
                Application.Run();

            Debug.Print("Exiting.");
        }
Example #3
0
 public virtual void OnAfterTest()
 {
     var js = this.js; this.js = null;
     if (js != null)
         js.Dispose();
 }