示例#1
0
        private void HideSolutionSection()
        {
            //ITeamExplorerSection findSectionViewModel = TeamExplorerUtils.Instance.FindSectionViewModel(CheckoutAndBuild2Package.GetGlobalService<CheckoutAndBuild2Package>(), TeamExplorerPageIds.Home, "CF14DCB8-809A-460F-B535-B2B93D5F10C");
            ITeamExplorer teamExplorer = serviceProvider.Get <ITeamExplorer>();

            if (teamExplorer.CurrentPage != null)
            {
                var solutionsSection = teamExplorer.CurrentPage.GetSections()
                                       .FirstOrDefault(section => section.GetType().FullName == "Microsoft.VisualStudio.TeamFoundation.TeamExplorer.Home.SolutionsSection");
                if (solutionsSection != null && serviceProvider.Get <SettingsService>().Get(SettingsKeys.HideSolutionSectionInTeamExplorerKey, true))
                {
                    SectionManager.ExcludeSection(solutionsSection);
                }
            }
        }