示例#1
0
 private void HideSplashWindow()
 {
     if (_splashWindow != null)
     {
         _splashWindow.Hide();
         _splashWindow = null;
     }
 }
示例#2
0
        /// <summary>
        /// Loads the kernel.
        /// </summary>
        protected async void LoadKernel()
        {
            try
            {
                CompositionRoot = new ApplicationHost();

                Logger = CompositionRoot.LogManager.GetLogger("App");

                var splash = new SplashWindow(CompositionRoot.ApplicationVersion);

                splash.Show();
                
                await CompositionRoot.Init();

                splash.Hide();

                var task = CompositionRoot.RunStartupTasks();

                new MainWindow(CompositionRoot.LogManager, CompositionRoot, CompositionRoot.ServerConfigurationManager, CompositionRoot.UserManager, CompositionRoot.LibraryManager, CompositionRoot.JsonSerializer, CompositionRoot.DisplayPreferencesRepository).Show();

                await task.ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Logger.ErrorException("Error launching application", ex);

                MessageBox.Show("There was an error launching Media Browser: " + ex.Message);

                // Shutdown the app with an error code
                Shutdown(1);
            }
        }
示例#3
0
        private void ShowSplashWindow()
        {
            var win = new SplashWindow(_appHost.ApplicationVersion);
            win.Show();

            _splashWindow = win;
        }
示例#4
0
        private void ShowSplashWindow(Progress<double> progress)
        {
            var win = new SplashWindow(_appHost.ApplicationVersion, progress);
            win.Show();

            _splashWindow = win;
        }