public void ReadWrite(SolutionInfo solutionInfo) { SingleProjectReaderWriterBase singleProjectReaderWriter = CreateSingleProjectReaderWriter(solutionInfo); foreach (string projectFileName in solutionInfo.ProjectFileNames) { ReadWrite(projectFileName, solutionInfo, singleProjectReaderWriter, performReadOnly: false); } }
private void ReadWrite(string projectFileName, SolutionInfo solutionInfo, SingleProjectReaderWriterBase singleProjectReaderWriter, bool performReadOnly) { XDocument projectDocument = XDocument.Load(projectFileName); if (null == projectDocument) { throw new InvalidDataException("Couldn't load project file '" + projectFileName + "'."); } ProjectInfo projectInfo = singleProjectReaderWriter.ReadWrite(projectFileName, solutionInfo, projectDocument, performReadOnly); solutionInfo.AddProject(projectInfo); if (!performReadOnly) { string destProjectFileName = _settings.ModifyFileName(projectFileName); var writer = new ModifiedTextFileWriter(destProjectFileName, _settings.BuildOptions.ShouldForceWriteCachedFiles()); if (writer.Write(projectDocument.ToString())) { _settings.Output.WriteLine("Creating project file " + destProjectFileName); } } }