void ObjWebBrowser_CreateWindow(object sender, GeckoCreateWindowEventArgs e) { WebBrowserHostControl wbhc = MainWindowServiceDispatcher.Instance.OpenWebBrowser(); WebBrowserControl wbc = wbhc.OpenNewWindow(); e.WebBrowser = wbc.ObjWebBrowser; }
protected virtual void Dispose(bool disposing) { Logging.Debug("WebBrowserControl::Dispose({0}) @{1}", disposing, dispose_count); WPFDoEvents.SafeExec(() => { // Prevent recursive run-away of the code via the chain: // // *** Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing) // ** Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose() // Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.WantsClose(Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayoutItem item) // Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.CloseContent(System.Windows.FrameworkElement fe) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.DeleteSearchers() // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose() // *** Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing) // ** Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose() // // and prevent partial/broken cleanup due to chains like this one, resulting in // a dispose_count == 2: // // =2 * Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose() // =2 * Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose() // =1 Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose() // =1 Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose() // Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.WantsClose(Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayoutItem item) // Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.CloseContent(System.Windows.FrameworkElement fe) // * Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.DeleteSearchers() // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.RebuildSearchers(System.Collections.Generic.HashSet<string> once_off_requested_web_searchers) // Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.ForceSnifferSearchers() // if (dispose_count == 0) { // Get rid of managed resources ObjWebBrowser?.Dispose(); ObjWebBrowser = null; // Multiple WebBrowserControl instances MAY SHARE a single WebBrowserHostControl. // It is passed to this class/instance as a reference anyway, so we SHOULD NOT // kill/dispose it in here! // //web_browser_host_control.Dispose(); web_browser_host_control = null; } }); WPFDoEvents.SafeExec(() => { ObjWebBrowser = null; web_browser_host_control = null; }); ++dispose_count; }
public static void Test() { WebBrowserHostControl wbc = new WebBrowserHostControl(); ControlHostingWindow chw = new ControlHostingWindow("Web browser", wbc); chw.Show(); WBC = wbc; Thread thread = new Thread(ThreadEntry); thread.Start(); thread.IsBackground = true; }
public WebBrowserControl(WebBrowserHostControl web_browser_host_control) { this.web_browser_host_control = web_browser_host_control; InitializeComponent(); ObjWebBrowser.CreateControl(); ObjWebBrowser.Navigating += ObjWebBrowser_Navigating; ObjWebBrowser.DocumentCompleted += ObjWebBrowser_DocumentCompleted; ObjWebBrowser.CreateWindow += ObjWebBrowser_CreateWindow; // Seems to crash Qiqqa in Gecko v13 - perhaps the statuses are updating too quickly or in parallel?! // Seems to work with gecko v21... ObjWebBrowser.StatusTextChanged += ObjWebBrowser_StatusTextChanged; }
public WebSearcherPreferenceControl(WebBrowserHostControl web_browser_host_control) { this.web_browser_host_control = web_browser_host_control; InitializeComponent(); ObjHeader.Img = Icons.GetAppIcon(Icons.WebPreferences); ObjHeader.Caption = "Web Preferences"; ObjHeader.SubCaption = "Please select the WebSearchers that you would like to appear as tabs in your Qiqqa web browser."; CmdSave.Icon = Icons.GetAppIcon(Icons.Save); CmdSave.Caption = "Save preferences"; CmdSave.Click += CmdSave_Click; CmdCancel.Icon = Icons.GetAppIcon(Icons.Cancel); CmdCancel.Caption = "Reset"; CmdCancel.Click += CmdCancel_Click; RepopulateWebSearchers(); Keyboard.Focus(ObjListWebSearchers); }