public void Save(string filename) { try { if (string.IsNullOrEmpty(filename)) { throw new ArgumentException("No slnfilter file specified."); } switch (Path.GetExtension(filename).ToLower()) { case ".slnfilter": var filterFile = FilterFile.FromFile(filename); SolutionFile filteredSolution = filterFile.Apply(); filteredSolution.Save(); break; default: throw new ArgumentException("File type must be .slnfilter"); } } catch (Exception ex) { MessageBox.Show(string.Format("Error while creating the solution file.\nException: {0}", ex)); } }
private void CreateNewSolution(SolutionFile[] solutionFiles) { var newSolution = new SolutionFile( Path.Combine(basePath, solutionName), PrepareHeaders(solutionFiles), PrepareProjects(solutionFiles), PrepareSections(solutionFiles)); MergeSolutionFiles(newSolution); newSolution.Save(); }
void CreateProjectFiles() { SlnFile = SourceDir.GetFile(_solutionName); var sol = new SolutionFile(SlnFile, SolutionConstants.VisualStudio2010Version); if (_solutionHasAddin) { sol.OpenWrapAddInEnabled = true; } var projectFile = SourceDir.GetDirectory(_project.Name).GetFile(_project.Name + ".csproj"); _project.Write(projectFile); sol.AddProject(projectFile); sol.Save(); }
private bool Save() { try { m_filterFile.WatchForChangesOnFilteredSolution = m_checkboxWatchForChangesOnFilteredSolution.Checked; m_filterFile.CopyReSharperFiles = m_checkboxCopyReSharperFiles.Checked; m_filterFile.Save(); SolutionFile filteredSolution = m_filterFile.Apply(); filteredSolution.Save(); return(true); } catch (Exception ex) { MessageBox.Show(string.Format("Error while creating the filter file.\nException: {0}", ex)); } return(false); }