Beispiel #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);
            }
        }
Beispiel #2
0
        public void LoadFile(string file)
        {
            var obj = ShellLoader.LoadFile(file, ServiceProvider);

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