/// <summary>
        /// Performs a deep search into the given solution folder, looking for all of the projects
        /// directly, or indirectly, under it.
        /// </summary>
        private IList <Project> GetSolutionFolderProjects(Project solutionDir)
        {
            List <Project> result = new List <Project>();

            // Indexes in ProjectItems start at 1 and go through Count.
            for (int i = 1; i <= solutionDir.ProjectItems.Count; ++i)
            {
                var item = solutionDir.ProjectItems.Item(i).SubProject;
                if (item == null)
                {
                    continue;
                }
                // If it's a folder, search projects under it.
                if (item.Kind == EnvDTE.Constants.vsProjectKindSolutionItems)
                {
                    result.AddRange(GetSolutionFolderProjects(item));
                }
                // Skipping unsupported projects.
                else if (ProjectHelper.IsValidSupported(item))
                {
                    result.Add(item);
                }
            }

            return(result);
        }
        private List <ProjectHelper> GetProjectList()
        {
            List <ProjectHelper> list = new List <ProjectHelper>();

            foreach (Project project in _solution.Projects)
            {
                if (ProjectHelper.IsValidSupported(project))
                {
                    list.Add(new ProjectHelper(project));
                }
            }

            return(list);
        }
        /// <summary>
        /// Lists all of the projects included in the solution, recursing as necessary to extract the
        /// projects from the solution folders.
        /// Internal for testing.
        /// </summary>
        private IList <Project> GetSolutionProjects()
        {
            List <Project> result = new List <Project>();

            var rootProjects = _solution.Projects;

            foreach (Project item in rootProjects)
            {
                // If it's a folder, search projects under it.
                if (item.Kind == EnvDTE.Constants.vsProjectKindSolutionItems)
                {
                    result.AddRange(GetSolutionFolderProjects(item));
                }
                // Skipping unsupported projects.
                else if (ProjectHelper.IsValidSupported(item))
                {
                    result.Add(item);
                }
            }

            return(result);
        }