public void CheckInputKey(object sender, TextChangedEventArgs e) { var textBox = sender as TextBox; var caretIndex = textBox?.SelectionStart; if (textBox.Text.Length == 0 || caretIndex == 0) { this.IsFriendScreenNamesShow.Value = false; return; } if (this.IsFriendScreenNamesShow.Value) { this.FilteringFriendScreenNames(textBox.Text, caretIndex.Value); } if (textBox.Text[(int)(caretIndex - 1)].ToString() == "@") { this.IsFriendScreenNamesShow.Value = true; return; } if (textBox.Text[(int)(caretIndex - 1)].ToString() == " ") { this.IsFriendScreenNamesShow.Value = false; } }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { try { if (!(sender is TextBox)) return; var textbox = sender as TextBox; if (!string.IsNullOrEmpty(textbox.Text)) { var hash = textbox.Text[0]; var value = textbox.Text.Substring(1); var isHex = System.Text.RegularExpressions.Regex.IsMatch(value, @"\A\b[0-9a-fA-F]+\b\Z"); if (hash == '#' && value.Length == 8 && isHex) { ColorValue = textbox.Text; textbox.BorderBrush = Frontend.Resources["TextBoxBorderThemeBrush"] as SolidColorBrush; return; } } textbox.BorderBrush = new SolidColorBrush(Helper.GetColorFromHexString(Frontend.AppColors.HighlightImportant)); } catch (Exception uiEx) { Frontend.UIError(uiEx); } }
private async void SearchBar_TextChanged(object sender, TextChangedEventArgs e) { if(((TextBox)sender).Text.Length >= 2) { await DoSearch(); } }
private void FindBoxTextChanged(object sender, TextChangedEventArgs e) { string textToFind = findBox.Text; if (textToFind != null) FindAndHighlightText(textToFind); }
void DesiredAccuracyInMeters_TextChanged(object sender, TextChangedEventArgs e) { try { uint value = uint.Parse(DesiredAccuracyInMeters.Text); SetDesiredAccuracyInMeters.IsEnabled = true; // clear out status message rootPage.NotifyUser("", NotifyType.StatusMessage); } catch (ArgumentNullException) { SetDesiredAccuracyInMeters.IsEnabled = false; } catch (FormatException) { rootPage.NotifyUser("Desired Accuracy must be a number", NotifyType.StatusMessage); SetDesiredAccuracyInMeters.IsEnabled = false; } catch (OverflowException) { rootPage.NotifyUser("Desired Accuracy is out of bounds", NotifyType.StatusMessage); SetDesiredAccuracyInMeters.IsEnabled = false; } }
void scriptEditor_TextChanged(object sender, TextChangedEventArgs e) { //clear folding markers e.ChangedRange.ClearFoldingMarkers(); //set markers for folding e.ChangedRange.SetFoldingMarkers("#<", "#>"); }
private void fctb_TextChanged(object sender, TextChangedEventArgs e) { //clear folding markers e.ChangedRange.ClearFoldingMarkers(); //set markers for folding e.ChangedRange.SetFoldingMarkers("{", "}"); }
void Location_TextChanged(object sender, TextChangedEventArgs e) { var entry = (Entry)sender; if (autoCompletionListView == null) { var p = (VisualElement)sender; double x = 0; double y = p.Bounds.Height; while (p != null) { x += p.Bounds.X; y += p.Bounds.Y; p = p.ParentView; } autoCompletionListView = new ListView() { BackgroundColor = Color.White }; autoCompletionListView.ItemTapped += (s, e1) => { entry.Text = (string)e1.Item; absoluteLayout.Children.Remove(autoCompletionListView); autoCompletionListView = null; }; absoluteLayout.Children.Add(autoCompletionListView, new Rectangle(x, y, entry.Bounds.Width, 1000)); } UpdateCompletionItems(entry); }
private void CSharpSyntaxHighlight(TextChangedEventArgs e) { fctb.LeftBracket = '('; fctb.RightBracket = ')'; fctb.LeftBracket2 = '\x0'; fctb.RightBracket2 = '\x0'; //clear style of changed range e.ChangedRange.ClearStyle(BlueStyle, BoldStyle, GrayStyle, MagentaStyle, GreenStyle, BrownStyle); //string highlighting e.ChangedRange.SetStyle(BrownStyle, @"""""|@""""|''|@"".*?""|(?<!@)(?<range>"".*?[^\\]"")|'.*?[^\\]'"); //comment highlighting e.ChangedRange.SetStyle(GreenStyle, @"//.*$", RegexOptions.Multiline); e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(/\*.*)", RegexOptions.Singleline); e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(.*\*/)", RegexOptions.Singleline|RegexOptions.RightToLeft); //number highlighting e.ChangedRange.SetStyle(MagentaStyle, @"\b\d+[\.]?\d*([eE]\-?\d+)?[lLdDfF]?\b|\b0x[a-fA-F\d]+\b"); //attribute highlighting e.ChangedRange.SetStyle(GrayStyle, @"^\s*(?<range>\[.+?\])\s*$", RegexOptions.Multiline); //class name highlighting e.ChangedRange.SetStyle(BoldStyle, @"\b(class|struct|enum|interface)\s+(?<range>\w+?)\b"); //keyword highlighting e.ChangedRange.SetStyle(BlueStyle, @"\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b|#region\b|#endregion\b"); //clear folding markers e.ChangedRange.ClearFoldingMarkers(); //set folding markers e.ChangedRange.SetFoldingMarkers("{", "}");//allow to collapse brackets block e.ChangedRange.SetFoldingMarkers(@"#region\b", @"#endregion\b");//allow to collapse #region blocks e.ChangedRange.SetFoldingMarkers(@"/\*", @"\*/");//allow to collapse comment block }
private void euroTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (changing) { if (euroTextBox.Text.Length > 0) { result = Double.TryParse(euroTextBox.Text, out euroToMarkka); if (result) { euroToMarkka = Convert.ToDouble(euroTextBox.Text); euroToMarkka = euroToMarkka * 5.94573; } else { euroToMarkka = 0; } } else { euroToMarkka = 0; } markkaTextBox.Text = euroToMarkka.ToString("0.00"); changing = false; } }
private void markkaTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (changing) { if (markkaTextBox.Text.Length > 0) { result = Double.TryParse(markkaTextBox.Text, out markkaToEuro); if (result) { markkaToEuro = Convert.ToDouble(markkaTextBox.Text); markkaToEuro = markkaToEuro / 5.94573; } else { markkaToEuro = 0; } } else { markkaToEuro = 0; } euroTextBox.Text = markkaToEuro.ToString("0.00"); changing = false; } }
private void BingKeyTextBox_TextChanged(object sender, TextChangedEventArgs e) { if ((sender as TextBox).Text.Length >= 64) LoadMapButton.IsEnabled = true; else LoadMapButton.IsEnabled = false; }
/// <summary> /// This is a temp implementation, make a server call when fully implemented /// Source From https://blog.verslu.is/xamarin/finding-nemo-implementing-xamarin-forms-searchbar/ /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> private async void SearchBar_OnTextChanged (object sender, TextChangedEventArgs e) { //todo : implement using server call var people = peopleListview.ItemsSource as ObservableCollection<Person>; if (people != null) { if (_originalSource == null) _originalSource = people; peopleListview.IsRefreshing = true; //Simulate long server call await Task.Delay (TimeSpan.FromSeconds (2)).ContinueWith ((r) => { // Device.BeginInvokeOnMainThread (() => // { // if (string.IsNullOrWhiteSpace(e.NewTextValue)) // peopleListview.ItemsSource = _originalSource; // else // peopleListview.ItemsSource = new ObservableCollection<Person>(_originalSource.Where(p => p.FullName.ToLower ().Contains(e.NewTextValue.ToLower ()) // || p.PhoneNumber.Contains (e.NewTextValue))); // // peopleListview.IsRefreshing = false; // }); }); } }
private async void playerName_TextChanged(object sender, TextChangedEventArgs e) { // ";[]{}" are forbidden in name because of json format, clear the latest character if it is any of those if (playerName.Text.Contains(";") || playerName.Text.Contains("[") || playerName.Text.Contains("]") || playerName.Text.Contains("{") || playerName.Text.Contains("}")) { playerName.Text = playerName.Text.Remove(playerName.Text.Length - 1); } // when player name field is cleared, disable button and do nothing else if (playerName.Text.Length == 0) { IsPrimaryButtonEnabled = false; infoText.Visibility = Windows.UI.Xaml.Visibility.Collapsed; return; } // try to get existing player from database var player = await SampleDataSource.GetPlayerAsync(playerName.Text); // if there is existing player with the name, disable button and show info text if (player != null) { IsPrimaryButtonEnabled = false; infoText.Visibility = Windows.UI.Xaml.Visibility.Visible; } // no players found from database, free to create one else { IsPrimaryButtonEnabled = true; infoText.Visibility = Windows.UI.Xaml.Visibility.Collapsed; } }
private void PPLSyntaxHighlight(TextChangedEventArgs e) { e.ChangedRange.SetStyle(_blueStyle, //available actions @"\b(when|and|or)\b", RegexOptions.IgnoreCase | RegexCompiledOption); }
private void SearchBar_OnTextChanged(object sender, TextChangedEventArgs e) { var model = BindingContext as UsageItemsViewModel; if(model == null) return; model.FilterItems.Execute(e.NewTextValue); }
private void fctb_TextChanged(object sender, TextChangedEventArgs e) { //clear old styles of chars e.ChangedRange.ClearStyle(ellipseStyle); //append style for word 'Babylon' e.ChangedRange.SetStyle(ellipseStyle, @"\bBabylon\b", RegexOptions.IgnoreCase); }
private void currentGradeTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (currentGradeTextBox.Text != "") { ((App)Application.Current).grades.currentGrade = Double.Parse(currentGradeTextBox.Text); } }
private void fctb_TextChanged(object sender, TextChangedEventArgs e) { e.ChangedRange.ClearStyle(StyleIndex.All); for (int i = 0; i < styles.Count; i++) e.ChangedRange.SetStyle(styles[i], @"\b" + i + @"\b"); }
// Doctor has started typing a patient's name in.. try to match the name // and output possible patients for him/her to select private void searchPatients(object sender, TextChangedEventArgs e) { if (search.Text == "Search for a Patient") { search.Text = ""; return; } // Remove all ids from the listbox while(MedicalID.Items.Count > 0) { MedicalID.Items.RemoveAt(MedicalID.Items.Count-1); } // Populate listbox with Possible suggestions string query = search.Text; for (uint i = 0; i < patients.Count; i++) { var name = patients.GetObjectAt(i).GetNamedString("Name"); var doctor = patients.GetObjectAt(i).GetNamedString("Doctor"); if (doctor == docName) { if(name.StartsWith(query)) MedicalID.Items.Add(name); } } }
private void OnTextChanged(object sender, TextChangedEventArgs e) { if (null != Command) { Command.Execute(e.NewTextValue); } }
private void fctb_TextChangedDelayed(object sender, TextChangedEventArgs e) { //delete all markers fctb.Range.ClearFoldingMarkers(); var currentIndent = 0; var lastNonEmptyLine = 0; for (int i = 0; i < fctb.LinesCount; i++) { var line = fctb[i]; var spacesCount = line.StartSpacesCount; if (spacesCount == line.Count) //empty line continue; if (currentIndent < spacesCount) //append start folding marker fctb[lastNonEmptyLine].FoldingStartMarker = "m" + currentIndent; else if (currentIndent > spacesCount) //append end folding marker fctb[lastNonEmptyLine].FoldingEndMarker = "m" + spacesCount; currentIndent = spacesCount; lastNonEmptyLine = i; } }
private void host_TextChanged(object sender, TextChangedEventArgs e) { if (settings.ContainsKey("Host")) settings["Host"] = host.Text; else settings.Add("Host", host.Text); }
private void ApplicantSearchTextBox_TextChanged(object sender, TextChangedEventArgs e) { filteredApplicants = new List<Person>(); var senderTextBox = (TextBox)sender; if (senderTextBox.Text.Equals("")) { ApplicantsListView.ItemsSource = applicants; } foreach (var applicant in applicants) { if (applicant.FirstName.ToLower().Contains(senderTextBox.Text.ToLower())){ filteredApplicants.Add(applicant); continue; } if (applicant.LastName.ToLower().Contains(senderTextBox.Text.ToLower())){ filteredApplicants.Add(applicant); continue; } var fullName = applicant.FirstName + " " + applicant.LastName; if (fullName.ToLower().Contains(senderTextBox.Text.ToLower())){ filteredApplicants.Add(applicant); continue; } } ApplicantsListView.ItemsSource = filteredApplicants; }
private async void ReplaceSeparatorChar(object sender, TextChangedEventArgs e) { double amount; if (double.TryParse(TextBoxAmount.Text, out amount)) { // todo: this try should be removeable, will see after the next version. try { //cursorpositon to set the position back after the formating var cursorposition = TextBoxAmount.SelectionStart; var formattedText = Utilities.FormatLargeNumbers(amount); cursorposition = AdjustCursorPosition(formattedText, cursorposition); TextBoxAmount.Text = formattedText; //set the cursor back to the last positon to avoid jumping around TextBoxAmount.Select(cursorposition, 0); } catch (FormatException ex) { Insights.Report(new ExtendedFormatException(ex, TextBoxAmount.Text)); } } else if (string.Equals(TextBoxAmount.Text, Strings.HelloWorldText, StringComparison.CurrentCultureIgnoreCase) || string.Equals(TextBoxAmount.Text, Strings.HalloWeltText, StringComparison.CurrentCultureIgnoreCase)) { await new MessageDialog(Strings.HelloWorldResponse).ShowAsync(); } }
public static void ValidatePhoneNumber(object sender, TextChangedEventArgs e){ Entry phoneNumber = sender as Entry; if (phoneNumber.Text == string.Empty) return; var numbers = Regex.Replace(phoneNumber.Text, @"\D", ""); if (numbers.Length <= 3) { phoneNumber.Text = numbers; return; } if (numbers.Length <= 7){ phoneNumber.Text = string.Format("{0}-{1}", numbers.Substring(0, 3), numbers.Substring(3)); return; } phoneNumber.Text = String.Format( "({0}) {1}-{2}", numbers.Substring(0, 3), numbers.Substring(3, 3), numbers.Substring(6) ); }
private void examWeightTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (examWeightTextBox.Text != "") { ((App)Application.Current).grades.examWeight = (Double.Parse(examWeightTextBox.Text)) / 100; } }
private void port_TextChanged(object sender, TextChangedEventArgs e) { if (settings.ContainsKey("Port")) settings["Port"] = port.Text; else settings.Add("Port", port.Text); }
void ColoredTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (this.Text.Length == 0) this.Background = new SolidColorBrush(Colors.Pink); else this.Background = new SolidColorBrush(Colors.White); }
private void fctb_TextChanged(object sender, TextChangedEventArgs e) { //clear previous highlighting e.ChangedRange.ClearStyle(brownStyle); //highlight tags e.ChangedRange.SetStyle(brownStyle, "<[^>]+>"); }
private void OnTextBoxOnTextChanged(object sender, TextChangedEventArgs args) { TextBox.ScrollToEnd(); }
//testing private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { // txt_bx_test.Text = AllPlayers[1].ToString(); }
private void txtVisaDate_TextChanged(object sender, TextChangedEventArgs e) { }
/// <summary> /// Sự kiện tìm kiếm nhanh /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtTimKiemNhanh_TextChanged(object sender, TextChangedEventArgs e) { }
private void textBox_itemId_TextChanged(object sender, TextChangedEventArgs e) { companyReturnManagerControler.textBox_itemId_TextChanged(); }
//user can change the speed of simulation private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { vm.VM_Play_Speed = ((TextBox)sender).Text; }
//validate legal angle value on input entered private void OnRotationValueInputTextChanged(object sender, TextChangedEventArgs args) { var MAX_ANGLE_DIGITS = 3; var textBox = sender as TextBox; var illegalInputMsg = "Input should only contain \nnumbers between -360 and 360!"; Double angleValue = 0.0; Regex negRgx = new Regex(@"^-[0-9]+$"); Regex posRgx = new Regex(@"^[0-9]+$"); Match negMatch = negRgx.Match(RotationValueTb.Text); Match posMatch = posRgx.Match(RotationValueTb.Text); DisplayIllegalValueNotificiation(null, false); if (textBox.Text.Contains("-")) { MAX_ANGLE_DIGITS++; } if (textBox.Text.Length > MAX_ANGLE_DIGITS) { textBox.Text = textBox.Text.Substring(0, MAX_ANGLE_DIGITS); return; } //negative angle if (negMatch.Success) { angleValue = Double.Parse(RotationValueTb.Text.Replace("-", "")); if (IsInValidRange(angleValue)) { RotationSlider.Value = angleValue * -1; } else { DisplayIllegalValueNotificiation(illegalInputMsg); textBox.Text = ""; } } //positive angle else if (posMatch.Success) { angleValue = Double.Parse(RotationValueTb.Text); if (IsInValidRange(angleValue)) { RotationSlider.Value = angleValue; } else { DisplayIllegalValueNotificiation(illegalInputMsg); textBox.Text = ""; } } //illegal input else { if (textBox.Text != "-") { textBox.Text = ""; DisplayIllegalValueNotificiation(illegalInputMsg); } } return; }
private void inputTextBox_TextChanged(object sender, TextChangedEventArgs e) { CheckIsTextValid(); }
private void PasswordTextBox_TextChanged(object sender, TextChangedEventArgs e) { passwordStrengthTextBlock.Text = PasswordValidator.CalculateStrength(passwordTextBox.Text).ToString(); }
private void RichTextBox_TextChanged(object sender, TextChangedEventArgs e) { }
private void TextChanged(object sender, TextChangedEventArgs e) { btnFetch.IsEnabled = ValueChanged(); }
private void txtBox_BatchSize_TextChanged(object sender, TextChangedEventArgs e) { _isDirty = true; }
protected override void OnTextChanged(TextChangedEventArgs e) { //this.ChangeValue(this.Text); }
private void txtName_TextChanged(object sender, TextChangedEventArgs e) { CollectionViewSource.GetDefaultView(dgFoods.ItemsSource).Refresh(); }
private void TextChanged_Var(object sender, TextChangedEventArgs args) { SearchModifications.SetTimer(); SearchModifications.VariableSearch = true; }
private void phoneExtTb_TextChanged(object sender, TextChangedEventArgs e) { new util.Validator().validateExtNumber(phoneNoTb, phoneExtTb, "เบอร์โทรศัพท์"); }
private void describtET_TextChanged(object sender, TextChangedEventArgs e) { }
private void Location_TextChanged(object sender, TextChangedEventArgs e) { var textBox = sender as TextBox; textBox.Text = NotesManager.GetFullName(textBox.Text); }
private void EmailET_TextChanged(object sender, TextChangedEventArgs e) { }
private void TextChanged_Fixed(object sender, TextChangedEventArgs args) { SearchModifications.SetTimer(); SearchModifications.FixedSearch = true; }
private void NicknameET_TextChanged(object sender, TextChangedEventArgs e) { }
private void addressET_TextChanged(object sender, TextChangedEventArgs e) { }
protected override void OnTextChanged(TextChangedEventArgs e) { base.OnTextChanged(e); HasText = Text.Length != 0; }
private void Del2ET_TextChanged(object sender, TextChangedEventArgs e) { }
private void CustomSearchUrl_TextChanged(object sender, TextChangedEventArgs e) { AppSettingsService.EditorCustomMadeSearchUrl = CustomSearchUrl.Text; CustomUrlErrorReport.Visibility = IsValidUrl(CustomSearchUrl.Text) ? Visibility.Collapsed : Visibility.Visible; }
private void LastNameET_TextChanged(object sender, TextChangedEventArgs e) { }
private void Bindable_TextChanged(object sender, TextChangedEventArgs e) { ((SearchBar)sender).SearchCommand?.Execute(e.NewTextValue); }
private void txtBox_UsernameChanged(object sender, TextChangedEventArgs e) { checkOK(); }
private void TextBlock_TextChanged(object sender, TextChangedEventArgs e) { }
private void SearchBar_TextChanged(object sender, TextChangedEventArgs e) { lvQuerylist.ItemsSource = HelpVM.FaqList.Where(x => x.key.ToLower().Contains(e.NewTextValue.ToLower())).ToList(); }