public WebApplicationEngine()
        {
            Engine             = new ScriptingEngine();
            Environment        = new RuntimeEnvironment();
            Engine.Environment = Environment;

            Engine.AttachAssembly(Assembly.GetExecutingAssembly(), Environment);
            Engine.AttachAssembly(typeof(SystemGlobalContext).Assembly, Environment);
            Engine.Initialize();
        }
示例#2
0
        public MinimalTypeSystemHack()
        {
            var Engine      = new ScriptingEngine();
            var Environment = new RuntimeEnvironment();

            Engine.Environment = Environment;

            Engine.AttachAssembly(typeof(WebApplicationEngine).Assembly, Environment);
            Engine.AttachAssembly(typeof(SystemGlobalContext).Assembly, Environment);
        }
示例#3
0
        private void StartEngine()
        {
            var Environment = new RuntimeEnvironment();

            engine             = new ScriptingEngine();
            engine.Environment = Environment;
            engine.AttachAssembly(System.Reflection.Assembly.GetAssembly(typeof(XmlReaderImpl)), Environment);
            engine.AttachAssembly(System.Reflection.Assembly.GetAssembly(typeof(XdtoObjectType)), Environment);
            engine.AttachAssembly(System.Reflection.Assembly.GetAssembly(typeof(Definitions)), Environment);
            engine.Initialize();
        }
        public WebApplicationEngine()
        {
            Engine             = new ScriptingEngine();
            Environment        = new RuntimeEnvironment();
            Engine.Environment = Environment;

            Engine.AttachAssembly(Assembly.GetExecutingAssembly(), Environment);
            Engine.AttachAssembly(typeof(SystemGlobalContext).Assembly, Environment);
            // TODO Убрать после реализации https://github.com/EvilBeaver/OneScript/issues/641
            TypeManager.RegisterType("Сценарий", typeof(UserScriptContextInstance));
            Engine.Initialize();
        }
        public void GlobalSetup()
        {
            // для инициализации долбаного глобального TypeManager
            var e = new ScriptingEngine();

            e.AttachAssembly(typeof(FileContext).Assembly);
        }
示例#6
0
        public HostedScriptEngine()
        {
            _engine = new ScriptingEngine();
            _env    = new RuntimeEnvironment();
            _engine.AttachAssembly(System.Reflection.Assembly.GetExecutingAssembly(), _env);

            _globalCtx = new SystemGlobalContext();
            _globalCtx.EngineInstance = _engine;

            _env.InjectObject(_globalCtx, false);
        }
示例#7
0
        public HostedScriptEngine()
        {
            _engine = new ScriptingEngine();
            _env = new RuntimeEnvironment();
            _engine.AttachAssembly(System.Reflection.Assembly.GetExecutingAssembly(), _env);

            _globalCtx = new SystemGlobalContext();
            _globalCtx.EngineInstance = _engine;

            _env.InjectObject(_globalCtx, false);
            _engine.Environment = _env;
            
            InitLibrariesByDefault();

        }
示例#8
0
        public HostedScriptEngine()
        {
            _engine = new ScriptingEngine();
            _env    = new RuntimeEnvironment();
            _engine.AttachAssembly(System.Reflection.Assembly.GetExecutingAssembly(), _env);

            _globalCtx = new SystemGlobalContext();
            _globalCtx.EngineInstance = _engine;

            _env.InjectObject(_globalCtx, false);

            InitializationCallback = (eng, env) =>
            {
                var templateFactory = new DefaultTemplatesFactory();
                var storage         = new TemplateStorage(templateFactory);
                env.InjectObject(storage);
                GlobalsManager.RegisterInstance(storage);
            };

            _engine.Environment = _env;
        }
示例#9
0
 public void AttachAssembly(System.Reflection.Assembly asm)
 {
     _engine.AttachAssembly(asm, _env);
 }
示例#10
0
        public void LoadLibrary(string dllPath)
        {
            var assembly = System.Reflection.Assembly.LoadFrom(dllPath);

            _engine.AttachAssembly(assembly, _env);
        }