Пример #1
0
        public IEnumerable <IPackageAction> CreateConsolidatePackageActions(
            ManagePackagesSearchResultViewModel packageViewModel)
        {
            bool firstInstall = true;

            foreach (ManageProjectViewModel project in GetProjectViewModelsForPackage(packageViewModel))
            {
                if (!CanConsolidate(project, packageViewModel))
                {
                    continue;
                }

                yield return(new InstallNuGetPackageAction(
                                 SelectedPackageSource.GetSourceRepositories(),
                                 solutionManager,
                                 project.Project,
                                 projectContext
                                 )
                {
                    IncludePrerelease = IncludePrerelease,
                    PackageId = packageViewModel.Id,
                    Version = packageViewModel.SelectedVersion,
                    LicensesMustBeAccepted = firstInstall
                });

                firstInstall = false;
            }
        }
Пример #2
0
        public IEnumerable <IPackageAction> CreateUpdatePackageActions(
            ManagePackagesSearchResultViewModel packageViewModel,
            IEnumerable <IDotNetProject> projects)
        {
            bool firstInstall = true;

            foreach (IDotNetProject project in projects)
            {
                if (IsPackageInstalledInProject(project, packageViewModel.Id))
                {
                    yield return(new InstallNuGetPackageAction(
                                     SelectedPackageSource.GetSourceRepositories(),
                                     solutionManager,
                                     project,
                                     projectContext
                                     )
                    {
                        IncludePrerelease = IncludePrerelease,
                        PackageId = packageViewModel.Id,
                        Version = packageViewModel.SelectedVersion,
                        LicensesMustBeAccepted = firstInstall
                    });

                    firstInstall = false;
                }
            }
        }
Пример #3
0
 public IPackageAction CreateInstallPackageAction(PackageSearchResultViewModel packageViewModel)
 {
     return(new InstallNuGetPackageAction(
                SelectedPackageSource.GetSourceRepositories(),
                solutionManager,
                dotNetProject,
                projectContext
                )
     {
         IncludePrerelease = IncludePrerelease,
         PackageId = packageViewModel.Id,
         Version = packageViewModel.SelectedVersion
     });
 }
Пример #4
0
 public IEnumerable <IPackageAction> CreateInstallPackageActions(
     ManagePackagesSearchResultViewModel packageViewModel,
     IEnumerable <IDotNetProject> projects)
 {
     return(projects.Select(project => {
         return new InstallNuGetPackageAction(
             SelectedPackageSource.GetSourceRepositories(),
             solutionManager,
             project,
             projectContext
             )
         {
             IncludePrerelease = IncludePrerelease,
             PackageId = packageViewModel.Id,
             Version = packageViewModel.SelectedVersion
         };
     }));
 }
        public IPackageAction CreateUpdatePackageAction(
            IEnumerable <ManagePackagesSearchResultViewModel> packageViewModels,
            IEnumerable <IDotNetProject> projects)
        {
            var action = new UpdateMultipleNuGetPackagesAction(
                SelectedPackageSource.GetSourceRepositories(),
                solutionManager,
                projectContext);

            foreach (IDotNetProject project in projects)
            {
                action.AddProject(project);
            }

            foreach (ManagePackagesSearchResultViewModel packageViewModel in packageViewModels)
            {
                action.AddPackageToUpdate(new PackageIdentity(packageViewModel.Id, packageViewModel.SelectedVersion));
            }

            return(action);
        }
Пример #6
0
 public IEnumerable <IPackageAction> CreateConsolidatePackageActions(
     ManagePackagesSearchResultViewModel packageViewModel,
     IEnumerable <IDotNetProject> projects)
 {
     foreach (IDotNetProject project in projects)
     {
         if (IsPackageInstalledInProjectWithDifferentVersion(project, packageViewModel.Id, packageViewModel.SelectedVersion))
         {
             yield return(new InstallNuGetPackageAction(
                              SelectedPackageSource.GetSourceRepositories(),
                              solutionManager,
                              project,
                              projectContext
                              )
             {
                 IncludePrerelease = IncludePrerelease,
                 PackageId = packageViewModel.Id,
                 Version = packageViewModel.SelectedVersion
             });
         }
     }
 }