public static async Task <string[]> GetProjectTypeGuidsAsync(this EnvDTE.Project project)
        {
            Verify.ArgumentIsNotNull(project, nameof(project));

            await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            // Get the vs hierarchy as an IVsAggregatableProject to get the project type guids
            IVsHierarchy hierarchy = await ToVsHierarchyAsync(project);

            string[] projectTypeGuids = VsHierarchyUtility.GetProjectTypeGuids(hierarchy, project.Kind);

            return(projectTypeGuids);
        }
Exemplo n.º 2
0
        public static string[] GetProjectTypeGuids(this EnvDTE.Project project)
        {
            Verify.ArgumentIsNotNull(project, nameof(project));

            ThreadHelper.ThrowIfNotOnUIThread();

            // Get the vs hierarchy as an IVsAggregatableProject to get the project type guids
            IVsHierarchy hierarchy = ToVsHierarchy(project);

            string[] projectTypeGuids = VsHierarchyUtility.GetProjectTypeGuids(hierarchy, project.Kind);

            return(projectTypeGuids);
        }
Exemplo n.º 3
0
        public static async Task CollapseAllNodesAsync(IDictionary <string, ISet <VsHierarchyItem> > ignoreNodes)
        {
            Verify.ArgumentIsNotNull(ignoreNodes, nameof(ignoreNodes));

            await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            var dte      = ServiceLocator.GetInstance <EnvDTE.DTE>();
            var projects = dte.Solution.Projects;

            foreach (var project in projects.Cast <EnvDTE.Project>())
            {
                ISet <VsHierarchyItem> expandedNodes;
                if (ignoreNodes.TryGetValue(project.GetUniqueName(), out expandedNodes)
                    &&
                    expandedNodes != null)
                {
                    CollapseProjectHierarchyItems(project, expandedNodes);
                }
            }
        }