public WebApplicationEngine() { Engine = new ScriptingEngine(); Environment = new RuntimeEnvironment(); Engine.Environment = Environment; Engine.AttachAssembly(Assembly.GetExecutingAssembly(), Environment); Engine.AttachAssembly(typeof(SystemGlobalContext).Assembly, Environment); Engine.Initialize(); }
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); }
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); }
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); }
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(); }
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; }
public void AttachAssembly(System.Reflection.Assembly asm) { _engine.AttachAssembly(asm, _env); }
public void LoadLibrary(string dllPath) { var assembly = System.Reflection.Assembly.LoadFrom(dllPath); _engine.AttachAssembly(assembly, _env); }