static ProgressMonitorStatusMessage GetProgressMonitorUpdateMessages(List <IPackageAction> packageActions) { int count = packageActions.Count; if (count == 1) { if (packageActions [0] is UpdateMultipleNuGetPackagesAction updateMultiplePackagesAction) { count = updateMultiplePackagesAction.PackagesToUpdate.Count(); if (count == 1) { return(ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage( updateMultiplePackagesAction.PackagesToUpdate.First().Id)); } } else { string packageId = packageActions.Cast <INuGetPackageAction> ().First().PackageId; return(ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageId)); } } return(new ProgressMonitorStatusMessage( GettextCatalog.GetString("Updating {0} packages...", count), GettextCatalog.GetString("{0} packages successfully updated.", count), GettextCatalog.GetString("Could not update packages."), GettextCatalog.GetString("{0} packages updated with warnings.", count) )); }
public override void Run(Solution solution, IList <PackageReferencesForCreatedProject> packageReferencesForCreatedProjects) { List <InstallPackageAction> installPackageActions = CreateInstallPackageActions(solution, packageReferencesForCreatedProjects); ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateInstallingProjectTemplatePackagesMessage(); backgroundPackageActionRunner.Run(progressMessage, installPackageActions); }
void RestorePackages(IEnumerable <DotNetProject> projects) { var actions = projects.Select(project => new RestoreNuGetPackagesInDotNetCoreProject(project)).ToList(); var message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage(); PackageManagementServices.BackgroundPackageActionRunner.Run(message, actions); }
ProgressMonitorStatusMessage GetProgressMonitorStatusMessages(List <INuGetPackageAction> packageActions) { if (packageActions.Count == 1) { string packageId = packageActions.OfType <INuGetPackageAction> ().First().PackageId; return(ProgressMonitorStatusMessageFactory.CreateInstallingSinglePackageMessage(packageId)); } return(ProgressMonitorStatusMessageFactory.CreateInstallingMultiplePackagesMessage(packageActions.Count)); }
public CheckForUpdatesProgressMonitor( IPackageManagementProgressMonitorFactory progressMonitorFactory, IPackageManagementEvents packageEvents) { progressMessage = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage(); this.progressMonitor = progressMonitorFactory.CreateProgressMonitor(progressMessage.Status); eventMonitor = new PackageUpdatesEventMonitor(progressMonitor, packageEvents); }
void Restore(PackageRestorer restorer, Action afterRestore) { ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesBeforeUpdateMessage(); PackageManagementBackgroundDispatcher.Dispatch(() => { restorer.Restore(progressMessage); if (!restorer.RestoreFailed) { afterRestore(); } }); }
ProgressMonitorStatusMessage GetProgressMonitorStatusMessages(List <IPackageAction> packageActions) { if (packageActions.Count == 1) { string packageId = packageActions.OfType <ProcessPackageAction> ().First().Package.Id; if (OlderPackageInstalledThanPackageSelected()) { return(ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageId)); } return(ProgressMonitorStatusMessageFactory.CreateInstallingSinglePackageMessage(packageId)); } return(ProgressMonitorStatusMessageFactory.CreateInstallingMultiplePackagesMessage(packageActions.Count)); }
public override void Run(Solution solution, IList <PackageReferencesForCreatedProject> packageReferencesForCreatedProjects) { List <IPackageAction> installPackageActions = CreatePackageActions(solution, packageReferencesForCreatedProjects); if (!installPackageActions.Any()) { return; } ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateInstallingProjectTemplatePackagesMessage(); PackageManagementMSBuildExtension.PackageRestoreTask = backgroundPackageActionRunner.RunAsync(progressMessage, installPackageActions); }
public void Run() { ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage(); IProgressMonitor progressMonitor = CreateProgressMonitor(progressMessage); try { RestorePackages(progressMonitor, progressMessage); } catch (Exception ex) { LoggingService.LogInternalError(ex); progressMonitor.Log.WriteLine(ex.Message); progressMonitor.ReportError(progressMessage.Error, null); progressMonitor.ShowPackageConsole(); progressMonitor.Dispose(); } }
static ProgressMonitorStatusMessage GetProgressMonitorUpdateMessages(List <IPackageAction> packageActions) { int count = packageActions.Count; if (count == 1) { string packageId = packageActions.OfType <INuGetPackageAction> ().First().PackageId; return(ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageId)); } return(new ProgressMonitorStatusMessage( GettextCatalog.GetString("Updating {0} packages...", count), GettextCatalog.GetString("{0} packages successfully updated.", count), GettextCatalog.GetString("Could not update packages."), GettextCatalog.GetString("{0} packages updated with warnings.", count) )); }
static ProgressMonitorStatusMessage GetProgressMonitorUninstallMessages(List <IPackageAction> packageActions) { int count = packageActions.Count; if (count == 1) { string packageId = packageActions.Cast <INuGetPackageAction> ().First().PackageId; return(ProgressMonitorStatusMessageFactory.CreateRemoveSinglePackageMessage(packageId)); } return(new ProgressMonitorStatusMessage( GettextCatalog.GetString("Removing {0} packages...", count), GettextCatalog.GetString("{0} packages successfully removed.", count), GettextCatalog.GetString("Could not remove packages."), GettextCatalog.GetString("{0} packages removed with warnings.", count) )); }
void CheckForPackageUpdatesWithProgressMonitor() { ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage(); using (IProgressMonitor progressMonitor = CreateProgressMonitor(progressMessage)) { try { using (var eventMonitor = new PackageUpdatesEventMonitor(progressMonitor)) { CheckForPackageUpdates(progressMonitor, progressMessage, eventMonitor); } } catch (Exception ex) { LoggingService.LogInternalError(ex); progressMonitor.Log.WriteLine(ex.Message); progressMonitor.ReportError(progressMessage.Error, null); progressMonitor.ShowPackageConsole(); } } }
public void Restore() { Restore(ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage()); }
protected virtual ProgressMonitorStatusMessage CreateCheckingPackageCompatibilityMessage() { return(ProgressMonitorStatusMessageFactory.CreateCheckingPackageCompatibilityMessage()); }
public void Run(PackageReferenceNode packageReferenceNode) { ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRetargetingSinglePackageMessage(packageReferenceNode.Id); Run(packageReferenceNode, progressMessage); }
ProgressMonitorStatusMessage CreateProgressMessage(string packageId) { return(ProgressMonitorStatusMessageFactory.CreateInstallingSinglePackageMessage(packageId)); }
void ShowStatusBarError(Exception ex) { ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateInstallingSinglePackageMessage(""); PackageManagementServices.BackgroundPackageActionRunner.ShowError(message, ex); }