3 using System.Reflection;
6 namespace DirectOutput.Scripting
17 public FileInfo File {
get;
private set; }
27 return (CompilationException == null);
34 public Exception CompilationException {
get;
private set; }
40 public Assembly Assembly {
get;
set; }
50 public Script(
string ScriptFilename,
bool ThrowExceptions =
false) : this(new FileInfo(ScriptFilename), ThrowExceptions) { }
59 public Script(FileInfo ScriptFile,
bool ThrowExceptions =
false)
61 this.File = ScriptFile;
66 A = CSScript.Load(ScriptFile.FullName, null,
true);
68 Log.
Write(
"Script file loaded and compiled: {0}".Build(ScriptFile.FullName));
72 CompilationException = e;
74 Log.
Exception(
"Could not load and compile script file: {0}".Build(ScriptFile.FullName), e);
78 throw new Exception(
"A error occured while loading or loading the script file {0}.".Build(ScriptFile.FullName),e);