Esempio n. 1
0
 protected override void Run()
 {
     try {
         ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();
         var action = new RestoreNuGetPackagesAction(GetSelectedSolution());
         PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
Esempio n. 2
0
        static void RestorePackages(Solution solution, Action <RestoreNuGetPackagesAction> modifyRestoreAction)
        {
            Runtime.AssertMainThread();

            try {
                ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();
                var action = new RestoreNuGetPackagesAction(solution);
                modifyRestoreAction(action);
                PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
            } catch (Exception ex) {
                ShowStatusBarError(ex);
            }
        }
        async Task RestoreAndCheckForUpdates(Solution solution)
        {
            bool checkUpdatesAfterRestore = ShouldCheckForUpdates && AnyProjectHasPackages(solution);

            var action = new RestoreAndCheckForUpdatesAction(solution)
            {
                CheckForUpdatesAfterRestore = checkUpdatesAfterRestore
            };
            bool packagesToRestore = await action.HasMissingPackages();

            if (packagesToRestore)
            {
                ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();
                PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
            }
            else if (checkUpdatesAfterRestore)
            {
                CheckForUpdates(solution);
            }
        }
Esempio n. 4
0
        static void ShowStatusBarError(Exception ex)
        {
            ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();

            PackageManagementServices.BackgroundPackageActionRunner.ShowError(message, ex);
        }