Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // Initialize current shell information here, since it won't be accurate if we wait until after we create our own windows
            SetIsCairoRunningAsShell();

            Host.Start();

            WriteApplicationDebugInfoToConsole();

            LoadExtensions();

            SetTheme();

            if (Settings.Instance.ForceSoftwareRendering)
            {
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
            }

            base.OnStartup(e);

            SetupWindowServices();

            ShellHelper.SetShellReadyEvent();

#if !DEBUG
            // login items only necessary if Explorer didn't start them
            bool isRestart = false;

            try
            {
                isRestart = _options.CurrentValue.Restart;
            }
            catch (Exception ex)
            {
                _logger.LogError($"Unable to read restart command line option: {ex.Message}");
            }

            if (EnvironmentHelper.IsAppRunningAsShell && !isRestart)
            {
                StartupRunner runner = new StartupRunner();
                runner.Run();
            }
#endif
        }
Ejemplo n.º 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // Initialize current shell information here, since it won't be accurate if we wait until after we create our own windows
            SetIsCairoRunningAsShell();

            Host.Start();

            WriteApplicationDebugInfoToConsole();

            LoadExtensions();

            SetTheme();

            if (Settings.Instance.ForceSoftwareRendering)
            {
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
            }

            base.OnStartup(e);

            SetupWindowServices();

            ShellHelper.SetShellReadyEvent();

#if ENABLEFIRSTRUN
            FirstRun();
#endif

#if !DEBUG
            // login items only necessary if Explorer didn't start them
            if (EnvironmentHelper.IsAppRunningAsShell && !_isRestart)
            {
                StartupRunner runner = new StartupRunner();
                runner.Run();
            }
#endif
        }
Ejemplo n.º 3
0
 public async Task PortableObjectStringLocalizerShouldRegisterIStringLocalizerOfT()
 => await StartupRunner.Run(typeof(PortableObjectLocalizationStartup), "en", "Hello");
Ejemplo n.º 4
0
 static void Main(string[] args)
 {
     StartupRunner.Run();
 }
 public async Task LocalizerReturnsTranslationFromInnerClass()
 => await StartupRunner.Run(typeof(PortableObjectStringLocalizerFactory), "ar", "مرحبا");
Ejemplo n.º 6
0
        public static void Main(string[] args)
        {
            #region Initialization Routines

            ProcessCommandLineArgs(args);
            if (!SingleInstanceCheck())
            {
                return;
            }
            SetShellReadyEvent();

            SetupSettings(); // run this before logging setup so that preferences are always used

            // Initialize current shell information here, since it won't be accurate if we wait until after we create our own Shell_TrayWnd
            Shell.SetIsCairoRunningAsShell();

            SetupLoggingSystem();
            WriteApplicationDebugInfoToConsole();

            SetSystemKeyboardShortcuts();

            // Move to App??? app.SetupPluginSystem();
            SetupPluginSystem(); // This will Load the Core Plugin and all other, will either reference it as a dependency or dont need it to be started first

            #endregion

            if (Settings.Instance.EnableDesktop && !GroupPolicyManager.Instance.NoDesktop) // Future: This should be moved to whatever plugin is responsible for desktop stuff
            {
                // hide the windows desktop
                Shell.ToggleDesktopIcons(false);
            }

            App app = new App();
            app.InitializeComponent();  // This sets up the Unhandled Exception stuff...

            setTheme(app);


            // Future: This should be moved to whatever plugin is responsible for Taskbar stuff
            if (Settings.Instance.EnableTaskbar)
            {
                AppBarHelper.SetWinTaskbarState(AppBarHelper.WinTaskbarState.AutoHide);
                AppBarHelper.SetWinTaskbarVisibility((int)NativeMethods.SetWindowPosFlags.SWP_HIDEWINDOW);
            }

            // Future: This should be moved to whatever plugin is responsible for MenuBar stuff
            MenuBar initialMenuBar = new MenuBar(System.Windows.Forms.Screen.PrimaryScreen);
            app.MainWindow = initialMenuBar;
            WindowManager.Instance.MenuBarWindows.Add(initialMenuBar);
            initialMenuBar.Show();

            // Future: This should be moved to whatever plugin is responsible for Desktop stuff
            if (Settings.Instance.EnableDesktop && !GroupPolicyManager.Instance.NoDesktop)
            {
                WindowManager.Instance.DesktopWindow = new Desktop();
                WindowManager.Instance.DesktopWindow.Show();
            }

            // Future: This should be moved to whatever plugin is responsible for Taskbar stuff
            if (Settings.Instance.EnableTaskbar)
            {
                Taskbar initialTaskbar = new Taskbar(System.Windows.Forms.Screen.PrimaryScreen);
                WindowManager.Instance.TaskbarWindows.Add(initialTaskbar);
                initialTaskbar.Show();
            }

            // Open windows on secondary displays and set work area
            WindowManager.Instance.InitialSetup();

            // Future: This should be moved to whatever plugin is responsible for SystemTray stuff. Possibly Core with no UI, then have a plugin that gives the UI?
            // Don't allow showing both the Windows taskbar and the Cairo tray
            if (Settings.Instance.EnableSysTray && (Settings.Instance.EnableTaskbar || Shell.IsCairoRunningAsShell))
            {
                NotificationArea.Instance.Initialize();
            }

#if ENABLEFIRSTRUN
            FirstRun();
#endif

#if !DEBUG
            // login items only necessary if Explorer didn't start them
            if (Shell.IsCairoRunningAsShell && !isRestart)
            {
                StartupRunner runner = new StartupRunner();
                runner.Run();
            }
#endif

            app.Run();
        }