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; } }
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; } } }
public IPackageAction CreateInstallPackageAction(PackageSearchResultViewModel packageViewModel) { return(new InstallNuGetPackageAction( SelectedPackageSource.GetSourceRepositories(), solutionManager, dotNetProject, projectContext ) { IncludePrerelease = IncludePrerelease, PackageId = packageViewModel.Id, Version = packageViewModel.SelectedVersion }); }
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); }
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 }); } } }