Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        public void AttachScript(string path, string typeName)
        {
            var compiler = EngineInstance.GetCompilerService();

            EngineInstance.AttachedScriptsFactory.AttachByPath(compiler, path, typeName);
        }
Ejemplo n.º 3
0
        public IRuntimeContextInstance LoadScript(string path)
        {
            var compiler = EngineInstance.GetCompilerService();

            return(EngineInstance.AttachedScriptsFactory.LoadFromPath(compiler, path));
        }