Esempio n. 1
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     Save_user_settings();
     Cef.Shutdown();
 }
Esempio n. 2
0
 private void ExitMenuItemClick(object sender, EventArgs e)
 {
     browser.Dispose();
     Cef.Shutdown();
     Close();
 }
Esempio n. 3
0
 private void BtnExit_Click(object sender, EventArgs e)
 {
     Cef.Shutdown();
     Environment.Exit(0);
 }
Esempio n. 4
0
 public static void Shutdown()
 {
     Cef.Shutdown();
     IsInitialized = false;
 }
Esempio n. 5
0
 /// <summary>
 /// Handles the <see cref="E:ApplicationExit" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private static void OnApplicationExit(object sender, EventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 6
0
 protected override void OnClosed(EventArgs e)
 {
     Cef.Shutdown();
     this.SubCount.localServer.Close();
     base.OnClosed(e);
 }
Esempio n. 7
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 8
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     //Be sure to shut the browser down before the app fully closes
     Cef.Shutdown();
 }
Esempio n. 9
0
 private void CefShutdown()
 {
     _isCefShutdown = true;
     Cef.Shutdown();
 }
Esempio n. 10
0
 private void Application_ApplicationExit(object sender, EventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 11
0
 public static void CleanupEnvironment()
 {
     Cef.Shutdown();
 }
Esempio n. 12
0
 private void OnClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
 {
     _browser.Dispose();
     Cef.Shutdown();
 }
 private void BroLauncher_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.SaveUsers();
     FavListSave();
     Cef.Shutdown();
 }
Esempio n. 14
0
 public void Close()
 {
     Cef.Shutdown();
 }
Esempio n. 15
0
        public static void Main()
        {
            try
            {
                var settings = new CefSettings
                {
                    CachePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cache"),
                    IgnoreCertificateErrors    = true,
                    LogSeverity                = LogSeverity.Disable,
                    PersistUserPreferences     = true,
                    WindowlessRenderingEnabled = true,
                    PersistSessionCookies      = true
                };
                settings.CefCommandLineArgs.Add("ignore-certificate-errors");
                // settings.CefCommandLineArgs.Add("no-proxy-server");
                // settings.CefCommandLineArgs.Add("disable-web-security");
                settings.CefCommandLineArgs.Add("allow-universal-access-from-files");
                settings.CefCommandLineArgs.Add("disable-extensions");
                settings.CefCommandLineArgs.Add("disable-plugins");
                settings.CefCommandLineArgs.Add("disable-pdf-extension");
                settings.CefCommandLineArgs.Add("disable-spell-checking");
                settings.CefCommandLineArgs.Add("disable-gpu");
                settings.CefCommandLineArgs.Add("disable-gpu-vsync");
                settings.DisableGpuAcceleration();

                /*settings.RegisterScheme(new CefCustomScheme
                 * {
                 *  SchemeName = "vrcx",
                 *  DomainName = "app",
                 *  SchemeHandlerFactory = new FolderSchemeHandlerFactory(Application.StartupPath + "/../../../html")
                 * });*/

                // MUST TURN ON (Error when creating a browser on certain systems.)
                CefSharpSettings.WcfEnabled     = true;
                CefSharpSettings.ShutdownOnExit = false;
                CefSharpSettings.SubprocessExitIfParentProcessClosed = true;

                Cef.EnableHighDPISupport();

                if (Cef.Initialize(settings, true, browserProcessHandler: null))
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    VRCXStorage.Load();
                    SQLite.Init();
                    CpuMonitor.Init();
                    Discord.Init();
                    LogWatcher.Init();
                    VRCXVR.Init();
                    Application.Run(new MainForm());
                    VRCXVR.Exit();
                    LogWatcher.Exit();
                    Discord.Exit();
                    CpuMonitor.Exit();
                    SQLite.Exit();
                    VRCXStorage.Save();
                    Cef.Shutdown();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"{ex.Message}\n{ex.StackTrace}", "PLEASE REPORT TO PYPY", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(0);
            }
        }
Esempio n. 16
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     Cef.Shutdown();
     Application.Exit();
 }
Esempio n. 17
0
 public static void Shutdown()
 {
     Cef.Shutdown();
 }
Esempio n. 18
0
 protected override void OnExit(ExitEventArgs e)
 {
     Cef.Shutdown();
     base.OnExit(e);
 }
Esempio n. 19
0
 public void Dispose()
 {
     browser.Dispose();
     Cef.Shutdown();
 }
Esempio n. 20
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);

            Cef.Shutdown();
        }
Esempio n. 21
0
 public void Dispose()
 {
     Cef.Shutdown();
 }
Esempio n. 22
0
 private void VideoPlayer_FormClosing(object sender, FormClosingEventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 23
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Cef.Shutdown();
     exeProcess.Kill();
 }
Esempio n. 24
0
        private void Window_Closing_1(object sender, CancelEventArgs e)
        {
            this.Hide();

            Cef.Shutdown();
        }
 private void FormTestJsCommunication_FormClosing(object sender, FormClosingEventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 26
0
        public static int Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-419");

            Application.ThreadException += new ExceptionHandler().ApplicationThreadException;
            AppDomain.CurrentDomain.UnhandledException += new ExceptionHandler().DomainUnhandledException;

            InitiateLogging();

            Cef.EnableHighDPISupport();

            //NOTE: Using a simple sub processes uses your existing application executable to spawn instances of the sub process.
            //Features like JSB, EvaluateScriptAsync, custom schemes require the CefSharp.BrowserSubprocess to function
            int exitCode = Cef.ExecuteProcess();

            if (exitCode >= 0)
            {
                return(exitCode);
            }


            //var browser = new BrowserForm(multiThreadedMessageLoop);
            //var browser = new SimpleBrowserForm();
            //var browser = new TabulationDemoForm();
            //var browser = new ToolbarFormBrowser();
            FormTabbedMDIBrowser browser = new FormTabbedMDIBrowser();

            IBrowserProcessHandler browserProcessHandler;

            if (multiThreadedMessageLoop)
            {
                browserProcessHandler = new BrowserProcessHandler();
            }
            else
            {
                //Get the current taskScheduler (must be called after the form is created)
                TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext();
                browserProcessHandler = new WinFormsBrowserProcessHandler(scheduler);
            }

            // cache path
            //To get the location the assembly normally resides on disk or the install directory
            string path      = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
            string directory = Path.GetDirectoryName(path);
            string localpath = new Uri(directory).LocalPath;

            if (!Directory.Exists(localpath))
            {
                Directory.CreateDirectory(localpath);
            }

            // need to make default/first cache folder
            localpath += "\\cachetab1";
            if (!Directory.Exists(localpath))
            {
                Directory.CreateDirectory(localpath);
            }

            CefSettings cefsetting = new CefSettings
            {
                MultiThreadedMessageLoop = multiThreadedMessageLoop,
                ExternalMessagePump      = !multiThreadedMessageLoop,
                AcceptLanguageList       = "es-419, es;q=0.8",
                Locale = "es",
                IgnoreCertificateErrors = true,
                UserAgent = userAgentWin10,
                CachePath = localpath,
            };

#if DEBUG
            cefsetting.LogSeverity = LogSeverity.Verbose;
            LogInfo("Running .exe Debug Version");
#else
            cefsetting.LogSeverity = LogSeverity.Error;
#endif

            Cef.Initialize(cefsetting, true, browserProcessHandler: browserProcessHandler);
            Thread.Sleep(3000); //time to start Cef

            Application.Run(browser);

            LogInfo("shutdown...");

            //Shutdown before your application exists or it will hang.
            Cef.Shutdown();

            // save user settings
            Properties.User.Default.Save();

            // close pending threats
            Environment.Exit(Environment.ExitCode);

            return(0);
        }
Esempio n. 27
0
 protected override void OnClosed(EventArgs e)
 {
     Cef.Shutdown();
     base.OnClosed(e);
 }
Esempio n. 28
0
 internal void Exit()
 {
     Cef.Shutdown();
 }
Esempio n. 29
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     Cef.Shutdown();
 }
Esempio n. 30
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     notifyIcon.Visible = false;
     Cef.Shutdown();
     Environment.Exit(0);
 }