static void Main() { oPATH.Init(); Settings settings = new Settings() { }; if (CEF.Initialize(settings) == false) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var m = new fOther(); var f = new fMain(m); CEF.RegisterScheme("local", new SchemeHandlerFactory()); CEF.RegisterScheme("img", new ImageHandlerFactory(f)); CEF.RegisterJsObject("api", f); Application.Run(f); //Application.Run(new fEditor("ability")); m.Close(); CEF.Shutdown(); }
public static void Main(string[] args) { System.Net.ServicePointManager.DefaultConnectionLimit = 1000; string pathCache = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Cache"); if (!Directory.Exists(pathCache)) { Directory.CreateDirectory(pathCache); } Settings settings = new Settings() { UserAgent = "Chrome7", CachePath = pathCache }; BrowserSettings browserSettings = new BrowserSettings() { PageCacheDisabled = true }; if (!CEF.Initialize(settings, browserSettings)) { Console.WriteLine("Couldn't initialise CEF"); return; } //CEF.RegisterScheme("local", new LocalSchemeHandlerFactory()); //CEF.RegisterScheme("test", new TestSchemeHandlerFactory()); //CEF.RegisterJsObject("bound", new BoundObject()); Application.Run(new MyForm()); CEF.Shutdown(); }
static void Main(string[] args) { if (!CEF.Initialize(new Settings())) { return; } Application.Run(new fMain()); CEF.Shutdown(); }
static void Main() { try { if (!GetUpdate()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FMain()); GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); GC.WaitForPendingFinalizers(); CEF.Shutdown(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void view_ExitActivated(object sender, EventArgs e) { model.Dispose(); CEF.Shutdown(); System.Environment.Exit(0); }
public static void Shutdown() { CEF.Shutdown(); }
/// <summary> /// Handles the ApplicationExit of System.Windows.Forms.Application. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The event arguments.</param> private static void Application_ApplicationExit(object sender, EventArgs e) { CEF.Shutdown(); }
void f_brow_Close() { browser.Dispose(); CEF.Shutdown(); }
public void TearDown() { createdEvent.WaitOne(); CEF.Shutdown(); Application.Exit(); }
public void Shutdown() { WebView.Dispose(); System.Threading.Thread.Sleep(1000); CEF.Shutdown(); }
static void Main(string[] args) { log4net.Config.XmlConfigurator.Configure(); //Mutex runOnce = null; //if (Properties.Settings.Default.IsRestarting == true) //{ // Properties.Settings.Default.IsRestarting = false; // Properties.Settings.Default.Save(); //} try { bool flag = false; runOnce = new Mutex(true, "SINGLE_INSTANCE", out flag); if (flag) { //Application.EnableVisualStyles(); runOnce.ReleaseMutex(); RequestHandler.Init(); Application.Run(new ChatForm()); CEF.Shutdown(); } else { MessageBox.Show("程序已经运行!", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } } finally { if (runOnce != null) { runOnce.Close(); } } //Process[] processes = Process.GetProcessesByName("daishu_message"); //if (processes.Length >= 2) //{ // MessageBox.Show("程序已经运行!", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //else //{ //LoginForm loginForm = new LoginForm(); //loginForm.ShowDialog(); //if (loginForm.DialogResult != DialogResult.Cancel) //{ // //} //} }
private void ExitMenuItemClick(object sender, EventArgs e) { browser.Dispose(); CEF.Shutdown(); Close(); }