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); } }
public void LoadString(string content, string folder = null) { var obj = ShellLoader.LoadString(content, ServiceProvider); LoadObject(obj, folder); }
public void LoadFile(string file) { var obj = ShellLoader.LoadFile(file, ServiceProvider); LoadObject(obj, Path.GetDirectoryName(file)); }