public void OpenUrl(string url) { TextBoxUrl.Text = url; wbc_browsing.Navigate(url); TextBoxUrl.SelectAll(); TabWebBrowserControls.MakeActive(TAB_BROWSING); }
internal void ObjWebBrowser_Navigating(WebBrowserControl wbc, Uri uri) { lblHintHowToUse.Visibility = Visibility.Hidden; if (wbc == active_wbc) { TextBoxUrl.Text = uri.ToString(); TextBoxUrl.SelectAll(); if (null != Navigating) { Navigating(uri); } } }
void DoBrowse() { FeatureTrackingManager.Instance.UseFeature(Features.Web_Browse); string uri = TextBoxUrl.Text; // If they are holding down CTRL, add www.XYZ.com to XYZ if ((Keyboard.Modifiers & ModifierKeys.Control) > 0) { if (!uri.EndsWith(".com")) { uri = uri + ".com"; } if (!uri.StartsWith("www.") && !uri.StartsWith("http")) { uri = "www." + uri; } TextBoxUrl.Text = uri; } // If they are missing http:// or the like, then add it if (uri.Contains('.') && !Uri.IsWellFormedUriString(uri, UriKind.Absolute)) { string http_uri = "http://" + uri; if (Uri.IsWellFormedUriString(http_uri, UriKind.Absolute)) { uri = http_uri; TextBoxUrl.Text = http_uri; } } if (Uri.IsWellFormedUriString(uri, UriKind.Absolute)) { CurrentWebBrowserControl.Navigate(new Uri(uri)); } else { DoWebSearch(uri); } // Reselect all text so that it is easy to retype TextBoxUrl.SelectAll(); }
/// <summary> /// Button add Url. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> private void BtnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TextBoxUrl.Text) || !NetworkManager.IsURLFormatted(WebsiteUrl())) { return; } ListViewItem _item = new ListViewItem(WebsiteUrl()); _item.SubItems.Add(NetworkManager.SourceExists(WebsiteUrl()).ToString()); if (Helper.IsItemInCollection(_item, ListViewUrlList)) { return; } ListViewUrlList.Items.Add(_item); UpdateDownloadsList(); TextBoxUrl.Clear(); }
private void ButtonLogin_Click(object sender, RoutedEventArgs e) { string loginUrl = TextBoxUrl.Text.Trim(); string loginApiKey = TextBoxApiKey.Password.Trim(); if (string.IsNullOrEmpty(loginUrl) || string.IsNullOrEmpty(loginApiKey)) { MessageBox.Show("Please enter the login credentials.", Title, MessageBoxButton.OK, MessageBoxImage.Information); } IsConnected = Login(loginUrl, loginApiKey); if (!IsConnected) { MessageBox.Show("Failed to login. Please check the credentials.", Title, MessageBoxButton.OK, MessageBoxImage.Information); TextBoxUrl.Focus(); } else { Close(); } }