private void ButtonMatch_Click(object sender, RoutedEventArgs e) { _vm.Init(GetOptions()); var match = _vm.Match(); if (match?.Success ?? false) { TextBox_Input.Focus(); TextBox_Input.Select(match.Index, match.Length); } }
// State management private void SetType(DictionaryType type) { ClearOutput(); ClearInput(); switch (type) { // Array case DictionaryType.DemoImplementation: dictionary = new DemoImplementation(); break; default: ShowMessage("Couldn't change type: Not implemented."); return; } ShowMessage("Changed type."); UpdateOutput(); TextBox_Input.Focus(); }
public MainWindow() { InitializeComponent(); TextBox_Regex.Text = "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"; TextBox_Input.Focus(); }
private void ClearInput() { TextBox_Input.Clear(); TextBox_Input.Focus(); }