void RunActionsWithProgressMonitor(
     ProgressMonitorStatusMessage progressMessage,
     IList <IPackageAction> installPackageActions,
     TaskCompletionSource <bool> taskCompletionSource,
     bool clearConsole,
     CancellationTokenSource cancellationTokenSource)
 {
     using (ProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor(progressMessage.Status, clearConsole, cancellationTokenSource)) {
         using (PackageManagementEventsMonitor eventMonitor = CreateEventMonitor(monitor, taskCompletionSource)) {
             try {
                 monitor.BeginTask(null, installPackageActions.Count);
                 RunActionsWithProgressMonitor(monitor, installPackageActions);
                 eventMonitor.ReportResult(progressMessage);
             } catch (Exception ex) {
                 RemoveInstallActions(installPackageActions);
                 bool showPackageConsole = !monitor.CancellationToken.IsCancellationRequested;
                 eventMonitor.ReportError(progressMessage, ex, showPackageConsole);
             } finally {
                 monitor.EndTask();
                 GuiDispatch(() => {
                     RemoveInstallActions(installPackageActions);
                     packageManagementEvents.OnPackageOperationsFinished();
                 });
             }
         }
     }
 }
		public CheckForUpdatesProgressMonitor (
			IPackageManagementProgressMonitorFactory progressMonitorFactory,
			IPackageManagementEvents packageEvents)
		{
			progressMessage = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage ();
			this.progressMonitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status);

			eventMonitor = new PackageUpdatesEventMonitor (progressMonitor, packageEvents);
		}
示例#3
0
        public CheckForUpdatesProgressMonitor(
            IPackageManagementProgressMonitorFactory progressMonitorFactory,
            IPackageManagementEvents packageEvents)
        {
            progressMessage      = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage();
            this.progressMonitor = progressMonitorFactory.CreateProgressMonitor(progressMessage.Status);

            eventMonitor = new PackageUpdatesEventMonitor(progressMonitor, packageEvents);
        }
 void RunActionsWithProgressMonitor(ProgressMonitorStatusMessage progressMessage, IList <IPackageAction> installPackageActions)
 {
     using (IProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor(progressMessage.Status)) {
         using (PackageManagementEventsMonitor eventMonitor = CreateEventMonitor(monitor)) {
             try {
                 monitor.BeginTask(null, installPackageActions.Count);
                 RunActionsWithProgressMonitor(monitor, installPackageActions);
                 eventMonitor.ReportResult(progressMessage);
             } catch (Exception ex) {
                 RemoveInstallActions(installPackageActions);
                 eventMonitor.ReportError(progressMessage, ex);
             } finally {
                 monitor.EndTask();
                 GuiDispatch(() => {
                     RemoveInstallActions(installPackageActions);
                     packageManagementEvents.OnPackageOperationsFinished();
                 });
             }
         }
     }
 }
示例#5
0
 IProgressMonitor CreateProgressMonitor(ProgressMonitorStatusMessage progressMessage)
 {
     return(progressMonitorFactory.CreateProgressMonitor(progressMessage.Status));
 }
 PackageManagementProgressMonitor CreateProgressMonitor(ProgressMonitorStatusMessage progressMessage)
 {
     return((PackageManagementProgressMonitor)progressMonitorFactory.CreateProgressMonitor(progressMessage.Status));
 }