示例#1
0
            public Results(IVsWebBrowser browser, IVsWindowFrame frame)
            {
                if (browser == null)
                {
                    throw new ArgumentNullException("browser");
                }
                if (frame == null)
                {
                    throw new ArgumentNullException("frame");
                }

                _browser = browser;
                _frame   = frame;
            }
        public static IVsWindowFrame LaunchInWebBrowser(IHostPlugin plugin, string url, string caption, bool newWindow,
                                                        out IVsWebBrowser browser)
        {
            var webBrowsingService = plugin.GetService <SVsWebBrowsingService>() as IVsWebBrowsingService;
            var vscreatewebbrowser = (__VSCREATEWEBBROWSER)1057;

            if (!newWindow)
            {
                vscreatewebbrowser = __VSCREATEWEBBROWSER.VSCWB_AddToMRU;
            }
            var            rguidOwner = new Guid();
            IVsWindowFrame ppFrame    = null;

            browser = null;
            if (webBrowsingService != null)
            {
                webBrowsingService.CreateWebBrowser((uint)vscreatewebbrowser, ref rguidOwner, caption, url, null, out browser,
                                                    out ppFrame);
            }
            return(ppFrame);
        }
示例#3
0
        private bool IntervalHandler(IVsWebBrowser browser, DispatcherTimer tmr)
        {
            IVsWebBrowsingService webBrowserService = ServiceProvider.GlobalProvider.GetService(typeof(IVsWebBrowsingService)) as IVsWebBrowsingService;

            if (webBrowserService != null)
            {
                IVsWebBrowser  ppBrowser;
                IVsWindowFrame ppFrame;
                webBrowserService.GetFirstWebBrowser(Guid.Empty, out ppFrame, out ppBrowser);
                if (ppFrame.IsVisible() == VSConstants.S_FALSE)
                {
                    tmr.Stop();
                    tmr.IsEnabled = false;
                }
                object urlObject;
                browser.GetDocumentInfo((uint)__VSWBDOCINFOINDEX.VSWBDI_DocURL, out urlObject);
                var url = urlObject as string;

                if (url != null && url.Contains(ConstValues.Params.AccessToken))
                {
                    SetKey(_authentication.GetTokenBasedOnUrl(url));
                    ppFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_NoSave);
                    VsShellUtilities.ShowMessageBox(
                        ServiceProvider.GlobalProvider,
                        "Plugin has been authorized!",
                        "Success",
                        OLEMSGICON.OLEMSGICON_INFO,
                        OLEMSGBUTTON.OLEMSGBUTTON_OK,
                        OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
                    tmr.Stop();
                    tmr.IsEnabled = false;
                    return(true);
                }
            }
            return(false);
        }
 /// <summary>
 /// The create web browser.
 /// </summary>
 /// <param name="dwCreateFlags">
 /// The dw create flags.
 /// </param>
 /// <param name="rguidOwner">
 /// The rguid owner.
 /// </param>
 /// <param name="lpszBaseCaption">
 /// The lpsz base caption.
 /// </param>
 /// <param name="lpszStartURL">
 /// The lpsz start url.
 /// </param>
 /// <param name="pUser">
 /// The p user.
 /// </param>
 /// <param name="ppBrowser">
 /// The pp browser.
 /// </param>
 /// <param name="ppFrame">
 /// The pp frame.
 /// </param>
 /// <returns>
 /// The create web browser.
 /// </returns>
 /// <exception cref="Exception">
 /// </exception>
 public int CreateWebBrowser(
     uint dwCreateFlags, ref Guid rguidOwner, string lpszBaseCaption, string lpszStartURL, IVsWebBrowserUser pUser, out IVsWebBrowser ppBrowser, out IVsWindowFrame ppFrame)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 /// <summary>
 /// The get first web browser.
 /// </summary>
 /// <param name="rguidPersistenceSlot">
 /// The rguid persistence slot.
 /// </param>
 /// <param name="ppFrame">
 /// The pp frame.
 /// </param>
 /// <param name="ppBrowser">
 /// The pp browser.
 /// </param>
 /// <returns>
 /// The get first web browser.
 /// </returns>
 /// <exception cref="Exception">
 /// </exception>
 public int GetFirstWebBrowser(ref Guid rguidPersistenceSlot, out IVsWindowFrame ppFrame, out IVsWebBrowser ppBrowser)
 {
     throw new Exception("The method or operation is not implemented.");
 }
示例#6
0
 /// <summary>
 /// The create web browser.
 /// </summary>
 /// <param name="dwCreateFlags">
 /// The dw create flags.
 /// </param>
 /// <param name="rguidOwner">
 /// The rguid owner.
 /// </param>
 /// <param name="lpszBaseCaption">
 /// The lpsz base caption.
 /// </param>
 /// <param name="lpszStartURL">
 /// The lpsz start url.
 /// </param>
 /// <param name="pUser">
 /// The p user.
 /// </param>
 /// <param name="ppBrowser">
 /// The pp browser.
 /// </param>
 /// <param name="ppFrame">
 /// The pp frame.
 /// </param>
 /// <returns>
 /// The create web browser.
 /// </returns>
 /// <exception cref="Exception">
 /// </exception>
 public int CreateWebBrowser(
     uint dwCreateFlags, ref Guid rguidOwner, string lpszBaseCaption, string lpszStartURL, IVsWebBrowserUser pUser, out IVsWebBrowser ppBrowser, out IVsWindowFrame ppFrame)
 {
     throw new Exception("The method or operation is not implemented.");
 }
示例#7
0
 /// <summary>
 /// The get first web browser.
 /// </summary>
 /// <param name="rguidPersistenceSlot">
 /// The rguid persistence slot.
 /// </param>
 /// <param name="ppFrame">
 /// The pp frame.
 /// </param>
 /// <param name="ppBrowser">
 /// The pp browser.
 /// </param>
 /// <returns>
 /// The get first web browser.
 /// </returns>
 /// <exception cref="Exception">
 /// </exception>
 public int GetFirstWebBrowser(ref Guid rguidPersistenceSlot, out IVsWindowFrame ppFrame, out IVsWebBrowser ppBrowser)
 {
     throw new Exception("The method or operation is not implemented.");
 }
示例#8
0
            public Results(IVsWebBrowser browser, IVsWindowFrame frame)
            {
                if (browser == null)
                    throw new ArgumentNullException("browser");
                if (frame == null)
                    throw new ArgumentNullException("frame");

                _browser = browser;
                _frame = frame;
            }