internal ScriptObject(IParsedScript parsedScript) { this.ScriptModifiedExternal = false; this.parsedScript = parsedScript; scriptState = new ScriptState(new TextBuffer(this)); if (null == this.parsedScript) throw new InvalidOperationException("Invalid 'parsedScript'!"); InitializeFileWatcher(parsedScript.GetScriptPath()); }
internal ScriptObject(string fileContent) { this.ScriptModifiedExternal = false; this.parsedScript = InterfaceFactory.CreateParsedScript(); if (string.IsNullOrEmpty(fileContent) == false) { MemoryStream inputStream = new MemoryStream( Encoding.Default.GetBytes(fileContent)); this.parsedScript.ParseStream(inputStream); } scriptState = new ScriptState(new TextBuffer(fileContent)); }