Beispiel #1
0
        public int addJSEngine(Engine eng)
        {
            PADengine pad = new PADengine(eng);

            engine.Add(pad);
            return(engine.Count - 1);
        }
Beispiel #2
0
        public int createEngine(List <string> scripts = null)
        {
            try
            {
                var eng = new Engine(cfg =>
                {
                    cfg.AllowClr();
#if DEBUG
                    cfg.AllowDebuggerStatement();
#else
                    cfg.AllowDebuggerStatement(false);
#endif
                }).SetValue("log", new Action <object>(Console.WriteLine));
                PADengine pad = new PADengine(eng);
                engine.Add(pad);
                return(engine.Count - 1);
            }
            catch (Exception i)
            {
                Console.WriteLine(i);
                return(-1);
            }
        }