Example #1
0
        private void OnBackgroundInitComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled || e.Error != null)
            {
                m_logger.Error("Error during initialization.");
                if (e.Error != null && m_logger != null)
                {
                    m_logger.Error(e.Error.Message);
                    m_logger.Error(e.Error.StackTrace);
                }

                Current.Shutdown(-1);
                return;
            }

            Current.Dispatcher.BeginInvoke(
                System.Windows.Threading.DispatcherPriority.Normal,
                (Action) delegate()
            {
                Exit += OnApplicationShutdown;

                // Must be done or our single instance enforcement is going to bug out.
                // https://github.com/TechnikEmpire/StahpIt-WPF/issues/2
                m_splashScreen.Close();
                m_splashScreen = null;
                //

                m_primaryWindow.Show();
                OnViewChangeRequest(this, new ViewChangeRequestArgs(View.Dashboard));
            }
                );

            // Check for updates, always.
            WinSparkle.CheckUpdateWithoutUI();
        }