Esempio n. 1
0
        /// <summary>
        /// Perform a search the moment were initialized
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Browser_IsBrowserInitializedChanged(object sender, EventArgs e)
        {
            var args = e as FrameLoadEndEventArgs;
            ChromiumWebBrowser browser = sender as ChromiumWebBrowser;

            if (args != null && args.Frame.IsMain)
            {
                // https://github.com/cefsharp/CefSharp/issues/3021
                if (browser?.CanExecuteJavascriptInMainFrame ?? true)
                {
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker) delegate { Browser_IsBrowserInitializedChanged(sender, e); });
                    }
                    else
                    {
                        _searchWindow?.UpdateListViewDelayed();

                        var isGdParsed      = _serviceProvider.Get <IDatabaseItemDao>().GetRowCount() > 0;
                        var settingsService = _serviceProvider.Get <SettingsService>();
                        _cefBrowserHandler.SetDarkMode(settingsService.GetPersistent().DarkMode);
                        _cefBrowserHandler.SetHideItemSkills(settingsService.GetPersistent().HideSkills);
                        _cefBrowserHandler.SetIsGrimParsed(isGdParsed);


                        _cefBrowserHandler.SetOnlineBackupsEnabled(!settingsService.GetLocal().OptOutOfBackups);
                    }
                }
            }
        }