Example #1
0
        private async Task <IEnumerable <Project> > GetProjectsInSolutionAsync(DTE dte)
        {
            IEnumerable <Project> allProjects = await EnvDTESolutionUtility.GetAllEnvDTEProjectsAsync(dte);

            IEnumerable <Project> supportedProjects = allProjects.Where(EnvDTEProjectUtility.IsSupported);

            return(supportedProjects);
        }
        private async Task <IEnumerable <Project> > GetProjectsInSolutionAsync(DTE dte)
        {
            IEnumerable <Project> allProjects = await EnvDTESolutionUtility.GetAllEnvDTEProjectsAsync(dte);

            var supportedProjects = new List <Project>();

            foreach (Project project in allProjects)
            {
                if (await EnvDTEProjectUtility.IsSupportedAsync(project))
                {
                    supportedProjects.Add(project);
                }
            }

            return(supportedProjects);
        }
Example #3
0
        private async Task <NuGetProject> CreateNuGetProjectAsync(string projectUniqueName)
        {
            await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            DTE dte = await _asyncServiceprovider.GetDTEAsync();

            IEnumerable <Project> supportedProjects = await EnvDTESolutionUtility.GetAllEnvDTEProjectsAsync(dte);

            foreach (Project solutionProject in supportedProjects)
            {
                string solutionProjectPath = solutionProject.GetFullProjectPath();

                if (!string.IsNullOrEmpty(solutionProjectPath) &&
                    PathUtility.GetStringComparerBasedOnOS().Equals(solutionProjectPath, projectUniqueName))
                {
                    return(await _solutionManager.Value.GetOrCreateProjectAsync(solutionProject, _projectContext.Value));
                }
            }

            return(null);
        }