public override void Initialize() { AvaloniaXamlLoader.Load(this); /* Clean everything from the old run up */ if (PlatformUtils.IsWindows) { #if WindowsNoARM ThePBone.Interop.Win32.TrayIcon.ResourceLoader.ClearCache(); #endif } if (Loc.IsTranslatorModeEnabled()) { SettingsProvider.Instance.Locale = Locales.custom; } ThemeUtils.Reload(); Loc.Load(); MediaKeyRemoteImpl.Init(); DeviceMessageCache.Init(); UpdateManager.Init(); ExperimentManager.Init(); Log.Information($"Translator mode file location: {Loc.GetTranslatorModeFile()}"); ScriptManager.Instance.RegisterUserHooks(); }
public void RestartApp(AbstractPage.Pages target) { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { MainWindow.Instance.DisableApplicationExit = true; MainWindow.Instance.OverrideMinimizeTray = true; MainWindow.Instance.Close(); MainWindow.Kill(); ThemeUtils.Reload(); desktop.MainWindow = MainWindow.Instance; desktop.MainWindow.Show(); MainWindow.Instance.Pager.SwitchPage(target); /* Restore crucial information */ SPPMessageHandler.Instance.DispatchEvent(DeviceMessageCache.Instance.ExtendedStatusUpdate); SPPMessageHandler.Instance.DispatchEvent(DeviceMessageCache.Instance.StatusUpdate); } }
public override void Initialize() { AvaloniaXamlLoader.Load(this); if (Loc.IsTranslatorModeEnabled()) { SettingsProvider.Instance.Locale = Locales.custom; } ThemeUtils.Reload(); Loc.Load(); MediaKeyRemoteImpl.Init(); DeviceMessageCache.Init(); UpdateManager.Init(); ExperimentManager.Init(); Log.Information($"Translator mode file location: {Loc.GetTranslatorModeFile()}"); ScriptManager.Instance.RegisterUserHooks(); }