Ejemplo n.º 1
0
        internal bool OpenFromFile(string filePath)
        {
            if (null != solutionData) // Close existing if any.
            {
                if (this.CloseSolution() == false)
                {
                    return(false);
                }
            }

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SolutionData));
                FileStream    fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
                solutionData = serializer.Deserialize(fileStream) as SolutionData;
                if (null == solutionData)
                {
                    return(false);
                }

                fileStream.Close();
            }
            catch (Exception)
            {
                return(false);
            }

            this.filePath = filePath;
            DeserializeFromScriptItems();
            this.solutionModified       = false;
            this.showSaveSolutionDialog = false;
            return(true);
        }
Ejemplo n.º 2
0
 private Solution()
 {
     this.Asynchronous   = false;
     solutionData        = new SolutionData(this);
     loadedScripts       = new List <IScriptObject>();
     linesUpdatedHandler = new LinesUpdatedHandler(OnTextBufferLinesUpdated);
 }
Ejemplo n.º 3
0
 private Solution()
 {
     this.Asynchronous = false;
     solutionData = new SolutionData(this);
     loadedScripts = new List<IScriptObject>();
     linesUpdatedHandler = new LinesUpdatedHandler(OnTextBufferLinesUpdated);
 }
Ejemplo n.º 4
0
        private bool CloseSolution()
        {
            if (null == solutionData)
            {
                return(true);
            }

            if (false != solutionModified)
            {
                if (SaveToFile(null) == false)
                {
                    return(false);
                }
            }

            solutionData = null;
            return(true);
        }