Example #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;
            }
        }
 public IEnumerable <KeyValuePair <string, string> > GetSources(bool includeUnOfficial, bool includeDisabled)
 {
     return(_packageSourceProvider.GetSources(includeUnOfficial, includeDisabled));
 }
        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);
        }
Example #4
0
        public IEnumerable <KeyValuePair <string, string> > GetSources(bool includeUnOfficial, bool includeDisabled)
        {
            IVsPackageSourceProvider packageSourceProvider = VisualStudioObjectProviders.GetComponentModelService <IVsPackageSourceProvider>();

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