Ejemplo n.º 1
0
        /// <summary>
        /// Loads the kernel.
        /// </summary>
        protected async void LoadKernel()
        {
            try
            {
                _appHost = new ApplicationHost(_appPaths, _logManager);

                _logger = _appHost.LogManager.GetLogger("App");

                await _appHost.Init();

                // Load default theme
                await _appHost.ThemeManager.LoadDefaultTheme();

                HiddenWindow = new HiddenWindow(_logManager.GetLogger("HiddenWindow"));
                HiddenWindow.Show();

                ShowApplicationWindow();

                _appHost.StartEntryPoints();

                await LoadInitialPresentation().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);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the kernel.
        /// </summary>
        protected async void LoadKernel()
        {
            try
            {
                _appHost = new ApplicationHost(_appPaths, _logManager);

                _logger = _appHost.LogManager.GetLogger("App");

                await _appHost.Init();

                // Load default theme
                await _appHost.ThemeManager.LoadDefaultTheme();

                HiddenWindow = new HiddenWindow(_logManager.GetLogger("HiddenWindow"));
                HiddenWindow.Show();

                ShowApplicationWindow();

                _appHost.StartEntryPoints();

                await LoadInitialPresentation().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);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Instantiates the main window.
        /// </summary>
        /// <returns>Window.</returns>
        protected Window InstantiateMainWindow()
        {
            HiddenWindow = new HiddenWindow(CompositionRoot);

            return HiddenWindow;
        }