Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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));
        }