/// <summary> /// Helper method to create a SolutionFile object, and call it to parse the SLN file /// represented by the string contents passed in. /// </summary> /// <param name="solutionFileContents"></param> /// <returns></returns> static internal SolutionFile ParseSolutionHelper(string solutionFileContents) { solutionFileContents = solutionFileContents.Replace('\'', '"'); StreamReader sr = StreamHelpers.StringToStreamReader(solutionFileContents); SolutionFile sp = new SolutionFile(); sp.SolutionFileDirectory = Path.GetTempPath(); sp.SolutionReader = sr; sp.FullPath = FileUtilities.GetTemporaryFileName(".sln"); sp.ParseSolution(); // Clean up the temporary file that got created with this call return sp; }
/// <summary> /// Helper method to create a SolutionFile object, and call it to parse the SLN file /// represented by the string contents passed in. /// </summary> /// <param name="solutionFileContents"></param> /// <returns></returns> static internal SolutionFile ParseSolutionHelper ( string solutionFileContents ) { solutionFileContents = solutionFileContents.Replace('\'', '"'); StreamReader sr = StreamHelpers.StringToStreamReader(solutionFileContents); SolutionFile sp = new SolutionFile(); sp.SolutionFileDirectory = Path.GetTempPath(); sp.SolutionReader = sr; string tmpFileName = FileUtilities.GetTemporaryFile(); sp.FullPath = tmpFileName + ".sln"; // This file is not expected to exist at this point, so make sure it doesn't File.Delete(sp.FullPath); sp.ParseSolution(); // Clean up the temporary file that got created with this call File.Delete(tmpFileName); return sp; }