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

            EngineInstance.AttachedScriptsFactory.AttachByPath(compiler, path, typeName);
        }
예제 #3
0
        public IRuntimeContextInstance LoadScript(string path)
        {
            var compiler = EngineInstance.GetCompilerService();

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