public void Destroy() { if (ieInstance != null) { try { Marshal.ReleaseComObject(ieInstance); } catch { } } if (_browser != null) { _browser.Dispose(); } if (testHelp != null) { testHelp.Dispose(); } testHelp = null; _browser = null; host = null; ieInstance = null; _mainHWND = IntPtr.Zero; }
public _BrowserWrapperIEImpl(BrowserWrapperIEImpl host) { this.host = host; this.SuspendLayout(); WebBrowser webBrowserControl = new WebBrowser(); webBrowserControl.Dock = System.Windows.Forms.DockStyle.Fill; webBrowserControl.Name = "webBrowser1"; webBrowserControl.TabIndex = 0; webBrowserControl.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(DocumentCompleted); webBrowserControl.Navigate("about:blank"); ieInstance = webBrowserControl.ActiveXInstance as SHDocVw.IWebBrowser2; _canvasHWND = webBrowserControl.Handle; _mainHWND = this.Handle; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BrowserWrapperIEImpl)); this.Controls.Add(webBrowserControl); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Name = "PerfTrackingBackground"; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Text = "Performance Tracking Background Process"; this.ResumeLayout(false); this.FormBorderStyle = FormBorderStyle.None; CheckUIHostRegistration(); }
public void Dispose() { if (m_defaultUIHandler != null) { Marshal.ReleaseComObject(m_defaultUIHandler); } lock (performanceTrackerLock) { if (performanceTracker != null) { try{ performanceTracker.StopTracking(null); }catch { } try{ performanceTracker.Dispose(); } catch { } } performanceTracker = null; } browserWrapperIEImpl = null; browser = null; m_defaultUIHandler = null; }
public IETestHelp(IDocHostUIHandler defaultUIHandler, BrowserIEImpl browser, BrowserWrapperIEImpl browserWrapperIEImpl) { this.JavascriptDelegates = new Dictionary <string, ExecuteJavascriptDelegate>(); this.JavascriptDelegates.Add("getSnapshot", new ExecuteJavascriptDelegate(this.TakeScreenshot)); this.JavascriptDelegates.Add("startperftest", new ExecuteJavascriptDelegate(this.StartPerformanceTracking)); this.JavascriptDelegates.Add("endperftest", new ExecuteJavascriptDelegate(this.StopPerformanceTracking)); this.JavascriptDelegates.Add("saveData", new ExecuteJavascriptDelegate(this.SaveDump)); this.JavascriptDelegates.Add("log", new ExecuteJavascriptDelegate(this.Log)); this.JavascriptDelegates.Add("onProgress", new ExecuteJavascriptDelegate(this.OnProgress)); this.JavascriptDelegates.Add("signal_test_started", new ExecuteJavascriptDelegate(this.SignalTestStarted)); this.JavascriptDelegates.Add("signal_test_ended", new ExecuteJavascriptDelegate(this.SignalTestEnded)); this.JavascriptDelegates.Add("redirect", new ExecuteJavascriptDelegate(this.RedirectPage)); this.JavascriptDelegates.Add("clearcache", new ExecuteJavascriptDelegate(this.ClearCache)); this.browserWrapperIEImpl = browserWrapperIEImpl; this.browser = browser; this.m_defaultUIHandler = defaultUIHandler; }