Ejemplo n.º 1
0
 private void InitializeAsyncronousEngine()
 {
     _asyncronousEngine = new AsyncronousEngine();
     _asyncronousEngine.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
     // Expose to the JavaScript world the function setUserMessage which add a a message to the UI
     _asyncronousEngine.Engine.SetValue("setUserMessage", new Action <string, bool>(__setUserMessage__));
 }
Ejemplo n.º 2
0
 private void RunScript(string script)
 {
     _asyncronousEngine = new AsyncronousEngine();
     _asyncronousEngine.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
     _asyncronousEngine.Engine.SetValue("storage", new Storage(_asyncronousEngine));
     _asyncronousEngine.RequestFileExecution(script, block: true);
 }
Ejemplo n.º 3
0
        private object Execute(string script)
        {
            _asyncronousEngine = new AsyncronousEngine();
            _asyncronousEngine.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
            _asyncronousEngine.Engine.SetValue("localStorage", LocalStorage.FromFile("Jint.Ex_UnitTests", _asyncronousEngine.Engine));

            var o = Jint.Ex.HelperClass.ConvertJsValueToNetValue(_asyncronousEngine.Execute(script));

            return(o);
        }
Ejemplo n.º 4
0
        static void SetIntervalDemo()
        {
            Console.WriteLine("Jint setInterval() demo");

            var ae = new AsyncronousEngine();

            ae.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
            ae.RequestFileExecution("setIntervalSetTimeoutNested.js");

            Console.WriteLine("Hit a key to stop");
            Console.ReadKey();
            ae.RequestClearQueue();

            Console.WriteLine("*** Done ***");
            Console.ReadKey();
        }
Ejemplo n.º 5
0
 private void Init()
 {
     _asyncronousEngine = new AsyncronousEngine();
     _asyncronousEngine.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
     _asyncronousEngine.Engine.SetValue("extension1", new Extension1(_asyncronousEngine));
 }
Ejemplo n.º 6
0
 public Extension1(AsyncronousEngine asyncronousEngine)
 {
     this._asyncronousEngine = asyncronousEngine;
 }
Ejemplo n.º 7
0
 private void Init()
 {
     _asyncronousEngine = new AsyncronousEngine();
     _asyncronousEngine.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
     _asyncronousEngine.Engine.SetValue("storage", new Storage(_asyncronousEngine));
 }
Ejemplo n.º 8
0
 public Storage(AsyncronousEngine asyncronousEngine)
 {
     this._asyncronousEngine = asyncronousEngine;
 }
Ejemplo n.º 9
0
 private AsyncronousEngine GetNewAsyncronousEngine()
 {
     ae = new AsyncronousEngine();
     ae.EmbedScriptAssemblies.Add(Assembly.GetExecutingAssembly());
     return(ae);
 }