public override void Execute()
 {
     if (SystemInformation.MouseButtonsSwapped || SystemParameters.SwapButtons)
     //TODO: somehow get which mouse button invoked this command
     {
         if (FunctionsDetails.Details.ContainsKey(Text))
         {
             WebBrowserForm.Show(FunctionsDetails.Details[Text]);
             // menuFunctionsToolTip.SetFunctionInfo(FunctionsDetails.Details[this.Text]);
             //menuFunctionsToolTip.Show(this, menuItem.Width + 3, 0);
             // menuFunctionsToolTip.Show();
         }
     }
     else
     {
         if ((int)SharedViewState.Instance.CurrentView < 4)
         {
             _expressionTextProvider.Text += Text;
         }
         else if ((int)SharedViewState.Instance.CurrentView == 4)
         {
             _scriptingTextProvider.Text += Text;
         }
         else if ((int)SharedViewState.Instance.CurrentView == 5)
         {
             _customFunctionsTextProvider.Text += Text;
         }
     }
 }
示例#2
0
        /// <summary>
        /// Called before a new popup window is created.
        /// </summary>
        /// <param name="browser">The parent browser window.</param>
        /// <param name="url">The URL of the popup.</param>
        /// <param name="x">The x-position of the popup.</param>
        /// <param name="y">The y-position of the popup.</param>
        /// <param name="width">The width of the popup.</param>
        /// <param name="height">The height of the popup.</param>
        /// <returns>Returns true to cancel creation of the popup window.</returns>
        public bool OnBeforePopup(IWebBrowser browser, string url, ref int x, ref int y, ref int width, ref int height)
        {
            WebBrowserForm popup = new WebBrowserForm(url);

            if (x > 0 && y > 0)
            {
                popup.Location = new Point(x, y);
            }

            if (width > 0 && height > 0)
            {
                popup.Size = new Size(width, height);
            }

            popup.Show();
            return(true);
        }
示例#3
0
 /// <summary>
 /// Open a URL in the default browser.
 /// </summary>
 /// <param name="url">The URL to open.</param>
 public void OpenUrl(string url)
 {
     if (GlobalSettings.Instance.UsePrivateBrowsing == GlobalSettings.Boolean.No || url.StartsWith("mailto:", StringComparison.OrdinalIgnoreCase))
     {
         Process.Start(url);
     }
     else
     {
         // If the URL is in the format of a Spotify URI then we need to shell this instead of opening
         // in the private browsing mode form.
         if (Regex.IsMatch(url, @"spotify:([^\s]+:)+[a-zA-Z0-9]+"))
         {
             Process.Start(url);
         }
         else
         {
             WebBrowserForm browser = new WebBrowserForm(url);
             browser.Show();
         }
     }
 }
示例#4
0
 /// <summary>
 /// Open a URL in the default browser.
 /// </summary>
 /// <param name="url">The URL to open.</param>
 public void OpenUrl(string url)
 {
     if (GlobalSettings.Instance.UsePrivateBrowsing == GlobalSettings.Boolean.No || url.StartsWith("mailto:", StringComparison.OrdinalIgnoreCase))
     {
         Process.Start(url);
     }
     else
     {
         // If the URL is in the format of a Spotify URI then we need to shell this instead of opening
         // in the private browsing mode form.
         if (Regex.IsMatch(url, @"spotify:([^\s]+:)+[a-zA-Z0-9]+"))
         {
             Process.Start(url);
         }
         else
         {
             WebBrowserForm browser = new WebBrowserForm(url);
             browser.Show();
         }
     }
 }