コード例 #1
0
        private void GetSourcesTest(object sender, EventArgs e)
        {
            EnvDTE.DTE dte = ServiceLocator.GetInstance <EnvDTE.DTE>();
            IVsPackageSourceProvider sourceProvider = ServiceLocator.GetInstance <IVsPackageSourceProvider>() as IVsPackageSourceProvider;

            foreach (EnvDTE.Project project in dte.Solution.Projects)
            {
                var sources = sourceProvider.GetSources(true, true);
                DisplayMessage("All sources", String.Join(", ", sources.Select(p => String.Format("[{0} {1}]", p.Key, p.Value))));
                return;
            }
        }
コード例 #2
0
 public IEnumerable <KeyValuePair <string, string> > GetSources(bool includeUnOfficial, bool includeDisabled)
 {
     return(_packageSourceProvider.GetSources(includeUnOfficial, includeDisabled));
 }
コード例 #3
0
        public void UpdatePackage(Project project, PackageModel newPkg, bool includeDependencies)
        {
            var pkgSrc = _PkgRepos.GetSources(true, false)?.FirstOrDefault(x => x.Key.Contains("nuget.org"));

            UpdatePackage(project, newPkg, includeDependencies, pkgSrc.Value.Value);
        }
コード例 #4
0
        public IEnumerable <KeyValuePair <string, string> > GetSources(bool includeUnOfficial, bool includeDisabled)
        {
            IVsPackageSourceProvider packageSourceProvider = VisualStudioObjectProviders.GetComponentModelService <IVsPackageSourceProvider>();

            return(packageSourceProvider.GetSources(includeUnOfficial, includeDisabled));
        }