public IRuntimeContextInstance LoadScript(string path, StructureImpl externalContext = null) { var compiler = EngineInstance.GetCompilerService(); if (externalContext == null) { return(EngineInstance.AttachedScriptsFactory.LoadFromPath(compiler, path)); } else { ExternalContextData extData = new ExternalContextData(); foreach (var item in externalContext) { extData.Add(item.Key.AsString(), item.Value); } return(EngineInstance.AttachedScriptsFactory.LoadFromPath(compiler, path, extData)); } }
public void AttachScript(string path, string typeName) { var compiler = EngineInstance.GetCompilerService(); EngineInstance.AttachedScriptsFactory.AttachByPath(compiler, path, typeName); }
public IRuntimeContextInstance LoadScript(string path) { var compiler = EngineInstance.GetCompilerService(); return(EngineInstance.AttachedScriptsFactory.LoadFromPath(compiler, path)); }