Ejemplo n.º 1
0
        public override void RegisterDoc()
        {
            base.RegisterDoc();

            if (registeredUIHandler == false)
            {
                registeredUIHandler = true;

                ICustomDoc cDoc   = this.m_pIWebBrowser2.Document as ICustomDoc;
                IOleObject oleObj = this.m_pIWebBrowser2.Document as IOleObject;

                if (oleObj != null && cDoc != null)
                {
                    IOleClientSite clientSite = null;
                    oleObj.GetClientSite(ref clientSite);

                    if (m_defaultUIHandler == null && clientSite != null)
                    {
                        m_defaultUIHandler = clientSite as IDocHostUIHandler;
                    }
                    if (cDoc != null)
                    {
                        cDoc.SetUIHandler(this);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        public override void Release()
        {
            base.Release();

            if (m_defaultUIHandler != null)
            {
                Marshal.ReleaseComObject(m_defaultUIHandler);
                m_defaultUIHandler = null;
            }
        }
Ejemplo n.º 4
0
        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;
        }
 protected void InstallCustomUIHandler(IDocHostUIHandler docHostUiHandler)
 {
     ArgumentUtility.CheckNotNull ("docHostUiHandler", docHostUiHandler);
       DocumentHostUiHandler = docHostUiHandler;
       AxIWebBrowser2.RegisterAsDropTarget = false;
       var customDoc = (ICustomDoc) AxIWebBrowser2.Document;
       if (customDoc != null)
     customDoc.SetUIHandler (docHostUiHandler);
 }