Beispiel #1
0
        public void Navigate(Uri url, AnkhBrowserArgs args, out AnkhBrowserResults results)
        {
            IVsWebBrowsingService browserSvc = GetService <IVsWebBrowsingService>(typeof(SVsWebBrowsingService));

            Guid           windowGuid = new Guid(ToolWindowGuids80.WebBrowserWindow);
            IVsWebBrowser  browser;
            IVsWindowFrame ppFrame;
            int            hr = browserSvc.CreateWebBrowser(
                (uint)args.CreateFlags,
                ref windowGuid,
                args.BaseCaption,
                url.ToString(),
                new BrowserUser(),
                out browser,
                out ppFrame);

            results = new Results(browser, ppFrame);
        }
Beispiel #2
0
        private void DoOpenVsBrowser(WebBrowserRole role, string url)
        {
            IVsWindowFrame frame;
            IVsWebBrowser  wb;
            var            guid = GetRoleGuid(role);

            if (guid == Guid.Empty)
            {
                _wbs.Navigate(url, (uint)__VSWBNAVIGATEFLAGS.VSNWB_ForceNew, out frame);
            }
            else
            {
                var flags = (uint)(__VSCREATEWEBBROWSER.VSCWB_AutoShow |
                                   __VSCREATEWEBBROWSER.VSCWB_ForceNew |
                                   __VSCREATEWEBBROWSER.VSCWB_StartCustom |
                                   __VSCREATEWEBBROWSER.VSCWB_ReuseExisting);
                var title = GetRoleWindowTitle(role);
                _wbs.CreateWebBrowser(flags, guid, title, url, null, out wb, out frame);
            }
        }
Beispiel #3
0
        public int VsBrowseUrl(Uri uri)
        {
            if (uri == null)
            {
                OutputGeneral("ERROR: url cannot be null");
                ErrorHandler.ThrowOnFailure(VSConstants.E_POINTER);
            }

            IVsWebBrowsingService browserService = GetWebBrowsingService();

            if (browserService == null)
            {
                OutputGeneral("ERROR: Cannot create browser service");
                ErrorHandler.ThrowOnFailure(VSConstants.E_UNEXPECTED);
            }

            Guid           guidNull = Guid.Empty;
            IVsWindowFrame frame;
            IVsWebBrowser  browser;
            uint           flags = (uint)(__VSCREATEWEBBROWSER.VSCWB_AutoShow | __VSCREATEWEBBROWSER.VSCWB_StartCustom | __VSCREATEWEBBROWSER.VSCWB_ReuseExisting);

            return(browserService.CreateWebBrowser(flags, ref guidNull, "", uri.AbsoluteUri, null, out browser, out frame));
        }