Exemplo n.º 1
0
        protected override void OnExit(ExitEventArgs e)
        {
            var applicationTracker = CustomContainer.Get <IApplicationTracker>();

            //Stop the action tracking
            applicationTracker?.DisableApplicationTracker();

            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }

            catch

            {
                // Best effort ;)
            }

            ForceShutdown();
        }
Exemplo n.º 2
0
        protected override void OnExit(ExitEventArgs e)
        {
            Tracker.Stop();

            // this is already handled ;)
            if (_mainViewModel != null)
            {
                _mainViewModel.PersistTabs(true);
            }
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            Browser.Shutdown();
            try
            {
                base.OnExit(e);
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                // Best effort ;)
            }

            ForceShutdown();
        }
Exemplo n.º 3
0
        public void ProgressFileDownloader_Cleanup_OnlyTempFilesDeleted()
        {
            //------------Setup for test--------------------------
            var dir = new Mock <IDirectory>();

            dir.Setup(a => a.GetFiles("c:\bob")).Returns(new[] { "tmpa", "tmpb", "c" });
            var file = new Mock <IFile>();

            ProgressFileDownloader.PerformCleanup(dir.Object, "c:\bob", file.Object);
            file.Verify(a => a.Delete(It.IsAny <string>()), Times.Exactly(2));
        }
Exemplo n.º 4
0
        protected override void OnExit(ExitEventArgs e)
        {
            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }
            catch
            {
                // Best effort ;)
            }

            ForceShutdown();
        }