/// <summary> /// Initializes the main window. /// </summary> private void InitializeMainWindow() { Loaded += MainWindow_Loaded; UrlTextBox.Text = @"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"; var args = Environment.GetCommandLineArgs(); if (args != null && args.Length > 1) { UrlTextBox.Text = args[1].Trim(); OpenCommand.Execute(); } OpenMediaPopup.Opened += (s, e) => { UrlTextBox.SelectAll(); UrlTextBox.Focus(); }; UrlTextBox.KeyDown += (s, e) => { if (e.Key == Key.Enter) { OpenCommand.Execute(); e.Handled = true; } }; }
void UrlTextBox_MouseUp(object sender, MouseEventArgs e) { if (!urlFocused && this.UrlTextBox.SelectionLength == 0) { urlFocused = true; UrlTextBox.SelectAll(); } }
void UrlTextBox_GotFocus(object sender, EventArgs e) { if (MouseButtons == MouseButtons.None) { UrlTextBox.SelectAll(); urlFocused = true; } }
private void UrlTextBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Uri uri; UrlTextBox.SelectAll(); if (Uri.TryCreate((sender as TextBox).Text, UriKind.Absolute, out uri)) { Process.Start(new ProcessStartInfo(uri.AbsoluteUri)); } }
private void UserControl_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) { var viewModel = DataContext as CodeLensCopyLinkResultViewModel; if (viewModel != null && viewModel.LinkGenerated) { viewModel.CopyAgainCommand.ExecuteAsync().Forget(); UrlTextBox.SelectAll(); } }
private void OnShown(object?sender, EventArgs e) { Activated -= OnShown; if (UrlTextBox.IsFocused && string.IsNullOrWhiteSpace(UrlTextBox.Text) && Uri.TryCreate(Clipboard.GetText(), UriKind.Absolute, out var uri) && uri.Scheme is "http" or "https") { UrlTextBox.UpdateBinding(TextBox.TextProperty, uri.ToString()); UrlTextBox.SelectAll(); } }
private void MakeURLButton_Click(object sender, RoutedEventArgs e) { string url = HtmlPage.Document.DocumentUri.AbsoluteUri; url = url.Split(' ', '?', '&')[0]; url += "?"; var str = IOStringFunctions.GlobalSettingsToUrl(); if (!string.IsNullOrWhiteSpace(str)) { url += str + "&"; } str = IOStringFunctions.TargetShapeToUrl(TargetShapeStream); if (!string.IsNullOrWhiteSpace(str)) { url += str + "&"; } url += IOStringFunctions.MechanismToUrl(); UrlTextBox.Text = url; UrlPopUpStackPanel.Visibility = Visibility.Visible; UrlTextBox.Focus(); UrlTextBox.SelectAll(); }
private void urlTextBox_GotFocus(object sender, RoutedEventArgs e) { MainModel.UrlViewModel.StoreCurrentValue(sender); UrlTextBox.SelectAll(); }
private void UrlInput_OnKeyboardFocus(object sender, RoutedEventArgs e) { UrlTextBox.SelectAll(); }
private void UrlTextBox_TextChanged(object sender, TextChangedEventArgs e) { UrlTextBox.SelectAll(); }