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); }
private Solution() { this.Asynchronous = false; solutionData = new SolutionData(this); loadedScripts = new List <IScriptObject>(); linesUpdatedHandler = new LinesUpdatedHandler(OnTextBufferLinesUpdated); }
private Solution() { this.Asynchronous = false; solutionData = new SolutionData(this); loadedScripts = new List<IScriptObject>(); linesUpdatedHandler = new LinesUpdatedHandler(OnTextBufferLinesUpdated); }
private bool CloseSolution() { if (null == solutionData) { return(true); } if (false != solutionModified) { if (SaveToFile(null) == false) { return(false); } } solutionData = null; return(true); }