/// <summary> /// Aborts the installation process /// </summary> public void Abort() { foreach (Thread thread in _installThreads) { if (thread != null) { thread.Abort(); } } if (_mainInstallerThread != null) { _mainInstallerThread.Abort(); } _installStatus.Create("ABORT"); _installStatus["ABORT"].Record("Abort received..."); }
private void CalculateStatistics(int queueCount, DateTime start, DateTime end, TimeSpan totalTime) { if (queueCount > 0) { UpdateStatus(end.ToString(Resource.DateTimeFormat, CultureInfo.CurrentCulture), StatusEventType.UpgradeEndTime); UpdateStatus(start.ToString(Resource.DateTimeFormat, CultureInfo.CurrentCulture), StatusEventType.UpgradeStartTime); long avgQueueCreationTime = totalTime.Ticks / (long)queueCount; TimeSpan avgQueueUpgradeTimeSpan = new TimeSpan(avgQueueCreationTime); string queueUpgradeDurationValue = Resource.DurationFormat.FormatWith ( avgQueueUpgradeTimeSpan.Hours, avgQueueUpgradeTimeSpan.Minutes, avgQueueUpgradeTimeSpan.Seconds, avgQueueUpgradeTimeSpan.Milliseconds ); UpdateStatus(queueUpgradeDurationValue, StatusEventType.AverageQueueUpgradeDuration); string durationValue = Resource.LongDurationFormat.FormatWith ( totalTime.Days, totalTime.Hours, totalTime.Minutes, totalTime.Seconds, totalTime.Milliseconds ); UpdateStatus(durationValue, StatusEventType.TotalUpgradeTime); PrinterInstallStatus status = _queueManager.Installer.InstallStatus; string key = "Overall Driver Upgrade Process"; status.Create(key); status[key].Record("OVERALL UPGRADE START", start); status[key].Record("OVERALL UPGRADE END", end); status[key].Record("AVERAGE QUEUE UPGRADE TIME", avgQueueUpgradeTimeSpan); status[key].Record("TOTAL QUEUE UPGRADE TIME", totalTime); } FireUpgradeCompleted(); }