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));
            }
        }
示例#2
0
        private void CreateNewSolution(SolutionFile[] solutionFiles)
        {
            var newSolution = new SolutionFile(
                Path.Combine(basePath, solutionName),
                PrepareHeaders(solutionFiles),
                PrepareProjects(solutionFiles),
                PrepareSections(solutionFiles));

            MergeSolutionFiles(newSolution);

            newSolution.Save();
        }
示例#3
0
        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();
        }
示例#4
0
        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);
        }