public override void DoCommand(object sender, EventArgs args)
        {
            var webSite = GetSelectedAzureWebSite();

            if (webSite == null)
            {
                throw new NotSupportedException();
            }

            Uri debugUri;

            if (Uri.TryCreate(webSite.Uri, "/ptvsd", out debugUri))
            {
                // Open the site's ptvsd page if it exists
                var req = WebRequest.CreateHttp(debugUri.AbsoluteUri);
                req.Method = "HEAD";
                req.Accept = "text/html";

                var dlgFactory             = (IVsThreadedWaitDialogFactory)_serviceProvider.GetService(typeof(SVsThreadedWaitDialogFactory));
                IVsThreadedWaitDialog2 dlg = null;
                if (dlgFactory != null && ErrorHandler.Succeeded(dlgFactory.CreateInstance(out dlg)))
                {
                    if (ErrorHandler.Failed(dlg.StartWaitDialog(
                                                Strings.ProductTitle,
                                                Strings.DebugAttachGettingSiteInformation,
                                                null,
                                                null,
                                                null,
                                                1,
                                                false,
                                                true
                                                )))
                    {
                        dlg = null;
                    }
                }
                try {
                    req.GetResponse().Close();
                } catch (WebException) {
                    debugUri = null;
                } finally {
                    if (dlg != null)
                    {
                        int dummy;
                        dlg.EndWaitDialog(out dummy);
                    }
                }
            }

            if (debugUri != null)
            {
                CommonPackage.OpenVsWebBrowser(_serviceProvider, debugUri.AbsoluteUri);
            }
            else
            {
                CommonPackage.OpenVsWebBrowser(_serviceProvider, "http://go.microsoft.com/fwlink/?LinkID=624026");
            }
        }
Ejemplo n.º 2
0
 public override void DoCommand(object sender, EventArgs args)
 {
     if (_useVSBrowser)
     {
         CommonPackage.OpenVsWebBrowser(_serviceProvider, _url);
     }
     else
     {
         CommonPackage.OpenWebBrowser(_url);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Open a file depending on the SubType property associated with the file item in the project file
        /// </summary>
        protected override void DoDefaultAction()
        {
            if ("WebBrowser".Equals(this.SubType, StringComparison.OrdinalIgnoreCase))
            {
                CommonPackage.OpenVsWebBrowser(this.ProjectMgr.Site, this.Url);
                return;
            }

            var manager = this.GetDocumentManager() as FileDocumentManager;

            Utilities.CheckNotNull(manager, "Could not get the FileDocumentManager");

            var viewGuid = Guid.Empty;

            manager.Open(false, false, viewGuid, out var frame, WindowFrameShowAction.Show);
        }
Ejemplo n.º 4
0
 private void OnlineHelp_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     CommonPackage.OpenVsWebBrowser(_site, PythonToolsPackage.InterpreterHelpUrl);
     e.Handled = true;
 }