Ejemplo n.º 1
0
        private bool StopPrepare(out string warningMessage)
        {
            if (_killingTimer != null)
            {
                _killingTimer.Dispose();
                _killingTimer = null;
            }

            this.BlurApply(UiUtils.DefaultBlurRadius, TimeSpan.FromMilliseconds(200), TimeSpan.Zero);
            var killingWaitWindow = new WaitWindow(_selfTesterAppName, "Killing Visual Studio's...")
            {
                Owner = this
            };
            var       countdownThreshold  = 10;
            const int launchTimerInterval = 500;

            /* В течении countdownThreshold * launchTimerInterval миллисекунд будем
             * принудительно завершать процессы, порожденные SelfTester'ом */
            _killingTimer = AutoResetTimer.Create(() =>
            {
                if (countdownThreshold-- > 0)
                {
                    ProcessUtils.MandatoryKill(Process.GetCurrentProcess(), false);
                }
                else
                {
                    _killingTimer.Dispose();
                    RunInUiSynchronizationContext(() =>
                    {
                        killingWaitWindow.Close();
                        this.BlurDisable(TimeSpan.FromSeconds(1), TimeSpan.Zero);
                    });
                }
            }, launchTimerInterval)
                            .Shedule(() => { RunInUiSynchronizationContext(() => killingWaitWindow.ShowDialogAlt()); });

            if (_testWorker != null && _testWorker.IsBusy)
            {
                _testWorker.CancelAsync();
                SetupSolutionInfoDataGrid(TestedSolutionsManager.RefreshTestingRunModel(_selectedRunFolder));
                SetUiCompletedState();
                UiUtils.ResetActiveStatuses(_currentSelectedSolutions, true);
                warningMessage = string.Empty;
                return(true);
            }

            warningMessage = Properties.Resources.AnalisysNotRunningNow;
            return(false);
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     _updateInstantTimer.Dispose();
     _updateConfigurationTimer.Dispose();
     _updateIsPausedTimer.Dispose();
     _checkForUpdatesTimer.Dispose();
     _enableAfterDelayTimer.Dispose();
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     _systemEvents.Dispose();
     _updateInstantTimer.Dispose();
     _updateConfigurationTimer.Dispose();
     _updateIsPausedTimer.Dispose();
     _pollingTimer.Dispose();
     _enableAfterDelayTimer.Dispose();
 }
Ejemplo n.º 4
0
        public void Dispose()
        {
            // Dispose stuff
            _updateTimer.Dispose();
            _settingsAutoSaveTimer.Dispose();
            _internetSyncTimer.Dispose();
            _checkForUpdatesTimer.Dispose();
            _enableAfterDelayTimer.Dispose();

            // Reset gamma
            _winApiService.SetGamma(ColorTemperature.Default);
        }
Ejemplo n.º 5
0
 public void Dispose()
 {
     _checkForUpdatesTimer.Dispose();
 }