Beispiel #1
0
        internal TextBuffer(string initialContent)
        {
            this.lineList = new List <string>();
            this.lineList.Add(initialContent);
            ArrangeTextBuffer();

            this.scriptModified = false;
            this.parsePending   = false;
            undoRedoRecorder    = new UndoRedoRecorder(this.lineList);
        }
Beispiel #2
0
        internal bool ReloadFromFile(string scriptFilePath)
        {
            if (string.IsNullOrEmpty(scriptFilePath))
            {
                return(false);
            }

            ScriptFileReader scriptReader = new ScriptFileReader(scriptFilePath, true);

            this.lineList = scriptReader.ReadInput();

            undoRedoRecorder = new UndoRedoRecorder(this.lineList);

            // Setting through these properties instead of directly to the data
            // members (i.e. this.parsePending and this.scriptModified) so that
            // UI listeners get notified of such reload event and update the UI
            // accordingly.
            //
            this.ParsePending   = true;
            this.ScriptModified = false;
            return(true);
        }
Beispiel #3
0
        internal TextBuffer(IScriptObject owningScript)
        {
            this.owningScript = owningScript;
            IParsedScript parsedScript = owningScript.GetParsedScript();

            if (parsedScript.GetScriptPath() == "")
            {
                this.lineList = new List <string>();
                this.lineList.Add(string.Empty);
            }
            else
            {
                string           scriptFilePath = parsedScript.GetScriptPath();
                ScriptFileReader scriptReader   = new ScriptFileReader(scriptFilePath, true);
                this.lineList = scriptReader.ReadInput();
            }

            undoRedoRecorder = new UndoRedoRecorder(this.lineList);

            this.parsePending   = true;
            this.scriptModified = false;
        }
Beispiel #4
0
        internal TextBuffer(string initialContent)
        {
            this.lineList = new List<string>();
            this.lineList.Add(initialContent);
            ArrangeTextBuffer();

            this.scriptModified = false;
            this.parsePending = false;
            undoRedoRecorder = new UndoRedoRecorder(this.lineList);
        }
Beispiel #5
0
        internal TextBuffer(IScriptObject owningScript)
        {
            this.owningScript = owningScript;
            IParsedScript parsedScript = owningScript.GetParsedScript();

            if (parsedScript.GetScriptPath() == "")
            {
                this.lineList = new List<string>();
                this.lineList.Add(string.Empty);
            }
            else
            {
                string scriptFilePath = parsedScript.GetScriptPath();
                ScriptFileReader scriptReader = new ScriptFileReader(scriptFilePath, true);
                this.lineList = scriptReader.ReadInput();
            }

            undoRedoRecorder = new UndoRedoRecorder(this.lineList);

            this.parsePending = true;
            this.scriptModified = false;
        }