Ejemplo n.º 1
0
        protected override void InitializeShell(Window shell)
        {
            LogClient.Info($"### STARTING {ProductInformation.ApplicationName}, version {ProcessExecutable.AssemblyVersion()}, IsPortable = {SettingsClient.BaseGet<bool>("Configuration", "IsPortable")}, Windows version = {EnvironmentUtils.GetFriendlyWindowsVersion()} ({EnvironmentUtils.GetInternalWindowsVersion()}), IsWindows10 = {Core.Base.Constants.IsWindows10} ###");

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            this.InitializeWcfServices();

            Current.MainWindow = shell;

            bool showOobe = SettingsClient.Get <bool>("General", "ShowOobe");

            if (showOobe)
            {
                var oobeWin = Container.Resolve <Oobe>();

                // These 2 lines are required to set the RegionManager of the child window.
                // If we don't do this, regions on child windows are never known by the Shell
                // RegionManager and navigation doesn't work
                RegionManager.SetRegionManager(oobeWin, Container.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();

                // Show the OOBE window. Don't tell the Indexer to start.
                // It will get a signal to start when the OOBE window closes.
                LogClient.Info("Showing Oobe screen");

                // Disable shutdown when the dialogs close
                Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;

                // Show as a dialog. This prevents further code execution until the dialog is closed.
                oobeWin.ShowDialog();
                oobeWin.ForceActivate();
            }

            // Re-enable normal shutdown mode
            Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            // Show the main window
            LogClient.Info("Showing Main screen");
            shell.Show();

            // We're not showing the OOBE screen, tell the IndexingService to start.
            if (!showOobe)
            {
                Container.Resolve <IIndexingService>().RefreshCollectionAsync();
            }
        }
Ejemplo n.º 2
0
        private void ExecuteStartup()
        {
            LogClient.Info("### STARTING {0}, version {1}, IsPortable = {2}, Windows version = {3} ({4}) ###", ProcessExecutable.Name(), ProcessExecutable.AssemblyVersion().ToString(), SettingsClient.BaseGet <bool>("Configuration", "IsPortable").ToString(), EnvironmentUtils.GetFriendlyWindowsVersion(), EnvironmentUtils.GetInternalWindowsVersion());

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);


            // Create a jumplist and assign it to the current application
            JumpList jl = new JumpList();

            JumpList.SetJumpList(Application.Current, jl);

            // Show the Splash Window
            Window splashWin = new Splash();

            splashWin.Show();
        }
Ejemplo n.º 3
0
        private void ExecuteStartup()
        {
            LogClient.Info($"### STARTING {ProductInformation.ApplicationName}, version {ProcessExecutable.AssemblyVersion()}, IsPortable = {SettingsClient.BaseGet<bool>("Configuration", "IsPortable")}, Windows version = {EnvironmentUtils.GetFriendlyWindowsVersion()} ({EnvironmentUtils.GetInternalWindowsVersion()}), IsWindows10 = {Constants.IsWindows10} ###");

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            var initializer = new Initializer();

            if (initializer.IsMigrationNeeded())
            {
                // Show the Update Window
                BorderlessWindows10Window initWin = new Initialize();
                initWin.Show();
                initWin.ForceActivate();
            }
            else
            {
                // Start the bootstrapper
                Bootstrapper bootstrapper = new Bootstrapper();
                bootstrapper.Run();
            }
        }
Ejemplo n.º 4
0
        private void ExecuteStartup()
        {
            LogClient.Info("### STARTING {0}, version {1}, IsPortable = {2}, Windows version = {3} ({4}) ###", ProductInformation.ApplicationDisplayName, ProcessExecutable.AssemblyVersion(), SettingsClient.BaseGet <bool>("Configuration", "IsPortable"), EnvironmentUtils.GetFriendlyWindowsVersion(), EnvironmentUtils.GetInternalWindowsVersion());

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            // Show the Splash Window
            Window splashWin = new Splash();

            splashWin.Show();
        }
Ejemplo n.º 5
0
        protected override void InitializeShell(Window shell)
        {
            LogClient.Info($"### STARTING {ProductInformation.ApplicationName}, version {ProcessExecutable.AssemblyVersion()}, IsPortable = {SettingsClient.BaseGet<bool>("Configuration", "IsPortable")}, Windows version = {EnvironmentUtils.GetFriendlyWindowsVersion()} ({EnvironmentUtils.GetInternalWindowsVersion()}), IsWindows10 = {Core.Base.Constants.IsWindows10} ###");

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            var initializer = new Initializer();

            if (initializer.IsMigrationNeeded())
            {
                // Show the Update Window
                var initWin = new Initialize();
                initWin.ShowDialog();
                initWin.ForceActivate();
            }

            this.InitializeWcfServices();

            Application.Current.MainWindow = shell;

            if (SettingsClient.Get <bool>("General", "ShowOobe"))
            {
                var oobeWin = Container.Resolve <Oobe>();

                // These 2 lines are required to set the RegionManager of the child window.
                // If we don't do this, regions on child windows are never known by the Shell
                // RegionManager and navigation doesn't work
                RegionManager.SetRegionManager(oobeWin, Container.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();

                // Show the OOBE window. Don't tell the Indexer to start.
                // It will get a signal to start when the OOBE window closes.
                LogClient.Info("Showing Oobe screen");
                oobeWin.ShowDialog();
                oobeWin.ForceActivate();
            }

            LogClient.Info("Showing Main screen");
            Application.Current.MainWindow.Show();

            // We're not showing the OOBE screen, tell the IndexingService to start.
            Container.Resolve <IIndexingService>().RefreshCollectionAsync();
        }
Ejemplo n.º 6
0
        private void ExecuteStartup()
        {
            LogClient.Info($"### STARTING {ProductInformation.ApplicationName}, version {ProcessExecutable.AssemblyVersion()}, IsPortable = {SettingsClient.BaseGet<bool>("Configuration", "IsPortable")}, Windows version = {EnvironmentUtils.GetFriendlyWindowsVersion()} ({EnvironmentUtils.GetInternalWindowsVersion()}), IsWindows10 = {Constants.IsWindows10} ###");

            // Handler for unhandled AppDomain exceptions
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            // Start the bootstrapper
            Bootstrapper bootstrapper = new Bootstrapper();

            bootstrapper.Run();
        }