Пример #1
0
        public CheckForUpdatesProgressMonitor(
            IPackageManagementProgressMonitorFactory progressMonitorFactory,
            IPackageManagementEvents packageEvents)
        {
            progressMessage      = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage();
            this.progressMonitor = progressMonitorFactory.CreateProgressMonitor(progressMessage.Status);

            eventMonitor = new PackageUpdatesEventMonitor(progressMonitor, packageEvents);
        }
Пример #2
0
        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();
                }
            }
        }