Exemple #1
0
        protected virtual IPackageFeed CreatePackageFeed(ManagePackagesLoadContext context)
        {
            if (PageSelected == ManagePackagesPage.Browse)
            {
                return(new MultiSourcePackageFeed(context.SourceRepositories, this));
            }

            if (PageSelected == ManagePackagesPage.Installed)
            {
                return(new InstalledPackageFeed(context, CreatePackageMetadataProvider(), new NullLogger()));
            }

            if (PageSelected == ManagePackagesPage.Updates)
            {
                return(new UpdatePackageFeed(
                           context,
                           CreatePackageMetadataProvider(),
                           new PackageSearchMetadataCache(),
                           new NullLogger()));
            }

            if (PageSelected == ManagePackagesPage.Consolidate)
            {
                return(new ConsolidatePackageFeed(context, CreatePackageMetadataProvider(), new NullLogger()));
            }

            throw new InvalidOperationException("Unsupported package feed");
        }
Exemple #2
0
        PackageItemLoader CreatePackageLoader()
        {
            var context = new ManagePackagesLoadContext(
                selectedPackageSource.GetSourceRepositories(),
                true,
                nugetProjects);

            var loader = new PackageItemLoader(
                context,
                CreatePackageFeed(context),
                SearchTerms,
                IncludePrerelease
                );

            currentLoader = loader;

            return(loader);
        }