Ejemplo n.º 1
0
        /// <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;
                }
            };
        }
Ejemplo n.º 2
0
 void UrlTextBox_MouseUp(object sender, MouseEventArgs e)
 {
     if (!urlFocused && this.UrlTextBox.SelectionLength == 0)
     {
         urlFocused = true;
         UrlTextBox.SelectAll();
     }
 }
Ejemplo n.º 3
0
 void UrlTextBox_GotFocus(object sender, EventArgs e)
 {
     if (MouseButtons == MouseButtons.None)
     {
         UrlTextBox.SelectAll();
         urlFocused = true;
     }
 }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 6
0
        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();
            }
        }
Ejemplo n.º 7
0
        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();
        }
Ejemplo n.º 8
0
 private void urlTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     MainModel.UrlViewModel.StoreCurrentValue(sender);
     UrlTextBox.SelectAll();
 }
Ejemplo n.º 9
0
 private void UrlInput_OnKeyboardFocus(object sender, RoutedEventArgs e)
 {
     UrlTextBox.SelectAll();
 }
 private void UrlTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     UrlTextBox.SelectAll();
 }