예제 #1
0
        public void IncludeFile(string file)
        {
            object obj = ShellLoader.LoadFile(file, ServiceProvider);

            var runnable = obj as IRunnable;

            if (runnable == null)
            {
                throw new Exception(String.Format("DBSH-00059 Included file {0} doesn't contain root element implementing IRunnable", file));
            }

            using (var childContext = CreateChildContext())
            {
                childContext.SetExecutingFolder(Path.GetDirectoryName(file));
                SetExecutingFolder(Path.GetDirectoryName(file));
                runnable.Run(childContext);
            }
        }
예제 #2
0
        public void LoadString(string content, string folder = null)
        {
            var obj = ShellLoader.LoadString(content, ServiceProvider);

            LoadObject(obj, folder);
        }
예제 #3
0
        public void LoadFile(string file)
        {
            var obj = ShellLoader.LoadFile(file, ServiceProvider);

            LoadObject(obj, Path.GetDirectoryName(file));
        }