private void rtb_TextChanged(object sender, TextChangedEventArgs e) { if (!IsLoaded) { return; } if (ChangeEventHelper.IsInChange) { return; } UndoRedoHelper.HandleTextChanged(e); LeftHighlightedParenthesis = Segment.Empty; RightHighlightedParenthesis = Segment.Empty; LeftHighlightedBracket = Segment.Empty; RightHighlightedBracket = Segment.Empty; LeftHighlightedCurlyBrace = Segment.Empty; RightHighlightedCurlyBrace = Segment.Empty; RecolouringLoop.SendWaitAndExecute( ); HighlightingLoop.SendWaitAndExecute( ); TextChanged?.Invoke(this, null); }
private void findTextChanged(object sender, EventArgs e) { _currentText = _searchBar.Input.Text; UpdateSuggestInput(); TextChanged?.Invoke(); }
protected void OnTextChanged() { if (TextChanged != null) { TextChanged.Invoke(this, EventArgs.Empty); } }
private void _editor_TextChanged(object sender, EventArgs e) { if (TextChanged != null) { TextChanged.Invoke(this, e); } }
private void TextDocument_TextChanged(object sender, EventArgs e) { UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(ProjectFile.Location); } if (unsavedFile == null) { lock (UnsavedFiles) { UnsavedFiles.InsertSorted(new UnsavedFile(ProjectFile.Location, TextDocument.Text)); } } else { unsavedFile.Contents = TextDocument.Text; } IsDirty = true; TextChanged?.Invoke(this, new EventArgs()); }
public MaterialEntry() { InitializeComponent(); EntryField.BindingContext = this; BottomBorder.BackgroundColor = DefaultColor; EntryField.TextChanged += (s, a) => { TextChanged?.Invoke(s, a); }; EntryField.Focused += async(s, a) => { EntryFocused?.Invoke(this, a); await CalculateLayoutFocused(); }; EntryField.Unfocused += async(s, a) => { EntryUnfocused?.Invoke(this, a); await CalculateLayoutUnfocused(); }; EntryField.PropertyChanged += async(sender, args) => { if (args.PropertyName == nameof(EntryField.Text) && !EntryField.IsFocused && !String.IsNullOrEmpty(EntryField.Text)) { await CalculateLayoutUnfocused(); } }; UpdateValidation(); }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { TextChanged?.Invoke(sender, args); string t = sender.Text.Trim(); if (!string.IsNullOrEmpty(TokenDelimiter) && t.Contains(TokenDelimiter)) { bool lastDelimited = t[t.Length - 1] == TokenDelimiter[0]; string[] tokens = t.Split(TokenDelimiter); int numberToProcess = lastDelimited ? tokens.Length : tokens.Length - 1; for (int position = 0; position < numberToProcess; position++) { string token = tokens[position]; token = token.Trim(); if (token.Length > 0) { _ = AddToken(token); } } if (lastDelimited) { sender.Text = string.Empty; } else { sender.Text = tokens[tokens.Length - 1]; } } }
private void TextArea_LostFocus(object sender, RoutedEventArgs e) { if (TextChanged != null) { TextChanged.Invoke(this, new TextChangedEventArgs(this.textEditor.Text)); } }
private void MonitorChanges(Action action) { var oldScrollBarParameter = curScrollBarParameter; var oldText = textViewText; var oldFirstVisibleLine = textViewFirstVisibleLine; action(); if (textViewText != oldText) { SelectionRange selectionRange = GetSelectionRange(); selectionDirty = false; TextChanged?.Invoke(this, textViewText, textViewFirstVisibleLine, selectionRange); } else if (textViewFirstVisibleLine != oldFirstVisibleLine) { FirstVisibleLineChanged?.Invoke(this, textViewFirstVisibleLine); } if (ScrollBarParameterChanged(oldScrollBarParameter, curScrollBarParameter)) { VScrollBarParameterChanged?.Invoke(this, curScrollBarParameter); IsAtEndOfFile = curScrollBarParameter.EndValue == 1; } }
private void InputTextBox_TextChanged(object sender, TextChangedEventArgs e) { TextChanged.Invoke(sender, e); var textBox = ((TextBox)sender); textBox.CaretIndex = textBox.Text.Length; }
/// <summary> /// Raises the FancyControls.Counter.ValueChanged event. /// </summary> /// <param name="e"> /// A FancyControls.ValueEventArgs that contains the event data. /// </param> protected void OnTextChanged(ValueEventArgs <string> e) { textLbl.Text = text; textLbl.Font = new Font(textLbl.Font.FontFamily, textFontSize); Algorithms.FitTextByWidth(textLbl); TextChanged?.Invoke(this, e); }
/// <summary> /// Handles resetting buttons when text boxes are changed. /// </summary> /// <param name="sender">Object that fired the event.</param> /// <param name="e">Event arguments.</param> private void commonTextChangedHandler(object sender, TextChangedEventArgs e) { if (Regex.IsMatch(this.secondBallTextBox.Text, @"[\d]{1}")) { // A digit was entered in the second text box, indicating that they got an open frame. // Lock the third text box. this.thirdBallTextBox.IsEnabled = false; } if (!this.thirdBallTextBox.IsEnabled && !(Regex.IsMatch(this.firstBallTextBox.Text, @"[\d]{1}") && Regex.IsMatch(this.secondBallTextBox.Text, @"[\d]{1}"))) { // The Strike button had been clicked and the second text box locked but the first text box is now clear. // Re-enable the second text box. this.thirdBallTextBox.IsEnabled = true; } if (this.firstBallTextBox.Text == "" && this.secondBallTextBox.Text == "/") { // The user entered a number, then clicked spare, and now tried to remove the first number without removing the spare. // Remove the spare. this.secondBallTextBox.Text = ""; } if (this.secondBallTextBox.Text == "" && this.thirdBallTextBox.Text == "/") { // The user entered a number, then clicked spare, and now tried to remove the first number without removing the spare. // Remove the spare. this.thirdBallTextBox.Text = ""; } TextChanged?.Invoke(sender, e); }
public FieldBox() { InitializeComponent(); fieldBox.TextChanged += (s, e) => TextChanged?.Invoke(s, e); fieldBox.PreviewTextInput += (s, e) => PreviewInput?.Invoke(s, e); fieldBox.LostFocus += (s, e) => InputLostFocus?.Invoke(s, e); }
protected override void OnApplyTemplate() { // TextChanged Event can trigger calls to characterCountPresenter ==> needs to be loaded first characterCountPresenter = GetTemplateChild <ContentPresenter>("CharacterCountPresenter"); textBoxControl = GetTemplateChild <TextBox>("TextTextBox"); textBoxControl.TextChanged += (s, e) => TextChanged?.Invoke(s, e); textBoxControl.KeyDown += TextBoxControl_KeyDown; textBoxControl.GotFocus += MaterialTextBox_GotFocus; textBoxControl.LostFocus += MaterialTextBox_LostFocus; labelPresenter = GetTemplateChild <ContentPresenter>("LabelPresenter"); labelPresenter.Loaded += LabelPresenter_Loaded; overlayTextPresenter = GetTemplateChild <ContentPresenter>("OverlayTextPresenter"); errorTextPanel = GetTemplateChild <StackPanel>("ErrorTextPanel"); this.PointerEntered += MaterialTextBox_PointerEntered; this.PointerExited += MaterialTextBox_PointerExited; SetCommonVisualStates(false); SetOverlayTextVisualStates(false); //SetLabelVisualState called in labelPresenter.Loaded event because the height property of the label is needed before the VisualState is set UpdateCharacterCountPresenter(); TextChanged += MaterialTextBox_TextChanged; isTemplatApplied = true; }
private void btnOpenFile_Click(object sender, RoutedEventArgs e) { Ookii.Dialogs.Wpf.VistaOpenFileDialog ofd = new Ookii.Dialogs.Wpf.VistaOpenFileDialog(); ofd.AddExtension = true; ofd.CheckFileExists = ofd.CheckPathExists = true; ofd.DefaultExt = DefaultExt; ofd.FileName = Filename; ofd.Filter = Filter; ofd.FilterIndex = FilterIndex; ofd.Multiselect = MultiSelect; ofd.RestoreDirectory = true; ofd.Title = Title; bool?Res = ofd.ShowDialog(); if (Res.HasValue && Res.Value) { Filename = ofd.FileName; Filenames = ofd.FileNames; Filter = ofd.Filter; FilterIndex = ofd.FilterIndex; TextChanged?.Invoke(this, new FileTextboxChangedEventArgs(Filename, Filenames)); } }
private void rtb_TextChanged(object sender, TextChangedEventArgs e) { if (!IsLoaded) { return; } if (ChangeEventHelper.IsInChange) { return; } RecolouringLoop.SendRewind( ); LocalUnderliningLoop.SendRewind( ); ExternalUnderliningLoop.SendRewind( ); UndoRedoHelper.HandleTextChanged(e); //... //lock( this ) //{ // LastMatches = null; // LastShowCaptures = false; // LastEol = null; //} MatchesUpdatedEvent.Reset( ); TextChanged?.Invoke(this, null); }
void OnTextChanged(object sender, EventArgs e) { if (TextChanged != null) { TextChanged.Invoke(this, e); } }
public override void Write(string value) { if (TextChanged != null) { TextChanged.Invoke(this, value); } }
/// ------------------------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------------------------ #region Private Functions /// ------------------------------------------------------------------------------------------------ /// /// ------------------------------------------------------------------------------------------------ /// Name InputTapped /// /// <summary> /// To give input value /// </summary> /// /// <remarks> /// </remarks> /// ------------------------------------------------------------------------------------------------ /// private async void InputTapped(object sender, EventArgs e) { try { var objSender = sender as Label; if (objSender != null) { if (Text != ParagraphViewModel.DEFAULT_VALUE_TEXT) { InputValue = Text; } InputValue = await DependencyService.Get <IInputDialog>().ShowDialog(InputValue); if (!string.IsNullOrWhiteSpace(InputValue)) { objSender.Text = _getText = InputValue; TextChanged.Invoke(); VisitActionDetailsPage.CurrentInstance.RefreshList(); } } } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }
private void rcb_ValueChanged(object sender, RoutedEventArgs e) { TextChanged?.Invoke(sender, new TextPickerEventArgs() { Text = (string)tbMain.Text, FontFamily = (string)rcb.Value2 }); }
public void FireTextChanged(string text, AutoSuggestBoxTextChangedEventArgs args) { suppressTextChangedEvent = true; Text = text; suppressTextChangedEvent = false; TextChanged?.Invoke(this, args); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); if (_showSearchButton != null) { _showSearchButton.Click -= SearchButton_Click; } if (_hideSearchButton != null) { _hideSearchButton.Click -= SearchButton_Click; } if (TryGetTemplatedChild(PART_ShowSearchButton, out _showSearchButton)) { _showSearchButton.Click += SearchButton_Click; } if (TryGetTemplatedChild(PART_HideSearchButton, out _hideSearchButton)) { _hideSearchButton.Click += SearchButton_Click; } _commandsFlyout = GetTemplatedChild <MenuFlyout>(PART_CommandsFlyout); _groupContent = GetTemplatedChild <VisualStateGroup>(GROUP_CommonStates); _autoSuggestBox = GetTemplatedChild <AutoSuggestBox>(PART_SearchBox); _autoSuggestBox.TextChanged += (s, e) => TextChanged?.Invoke(s, e); _autoSuggestBox.SuggestionChosen += (s, e) => SuggestionChoosen?.Invoke(s, e); _autoSuggestBox.QuerySubmitted += (s, e) => QuerySubmitted?.Invoke(s, e); Update(); }
public override void Draw() { if (this.Style == null) { this.Style = new UnityEngine.GUIStyle(UnityEngine.GUI.skin.textArea); } if (_SetRichText.HasValue) { this.Style.richText = _SetRichText.Value; _SetRichText = null; } if (this.Visible) { String newText = UnityEngine.GUILayout.TextArea(Text, Style, Options); if (IsEditable && newText != Text) { TextChanged?.Invoke(this); } if (IsEditable) { Text = newText; } } }
private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e) { TextChanged?.Invoke(this, new Projekt_HKP.GUI.Events.TextChangedEventArgs() { NewText = Text }); }
public void SetText(string text) { TypedText = string.Empty; textInputEventArgs.Clear(); TypedText = text; TextChanged?.Invoke(TypedText); }
private void TextChangedEvent() { if (TextChanged != null) { TextChanged.Invoke(); } }
// Called by the native control when users enter text internal void NativeControlTextChanged(string text, AutoSuggestionBoxTextChangeReason reason) { suppressTextChangedEvent = true; //prevent loop of events raising, as setting this property will make it back into the native control Text = text; suppressTextChangedEvent = false; TextChanged?.Invoke(this, new AutoSuggestBoxTextChangedEventArgs(reason)); }
public FileViewerInternal() { InitializeComponent(); InitializeComplete(); _currentViewPositionCache = new CurrentViewPositionCache(this); TextEditor.TextChanged += (s, e) => TextChanged?.Invoke(s, e); TextEditor.ActiveTextAreaControl.VScrollBar.ValueChanged += (s, e) => ScrollPosChanged?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.KeyUp += (s, e) => KeyUp?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.DoubleClick += (s, e) => DoubleClick?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.MouseMove += (s, e) => MouseMove?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.MouseEnter += (s, e) => MouseEnter?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.MouseLeave += (s, e) => MouseLeave?.Invoke(s, e); TextEditor.ActiveTextAreaControl.TextArea.MouseDown += (s, e) => { SelectedLineChanged?.Invoke( this, new SelectedLineEventArgs( TextEditor.ActiveTextAreaControl.TextArea.TextView.GetLogicalLine(e.Y))); }; HighlightingManager.Manager.DefaultHighlighting.SetColorFor("LineNumbers", new HighlightColor(Color.FromArgb(80, 0, 0, 0), Color.White, false, false)); TextEditor.ActiveTextAreaControl.TextEditorProperties.EnableFolding = false; _lineNumbersControl = new DiffViewerLineNumberControl(TextEditor.ActiveTextAreaControl.TextArea); VRulerPosition = AppSettings.DiffVerticalRulerPosition; }
protected virtual void OnTextChanged(EventArgs e) { var text = this.Text; TextChanged?.Invoke(this, new TextChangedEventArgs { Text = text }); }
private Task UpdateValue(float value) { var text = value <= 0 ? "" : $"{Zoom}: {value:#0.##}"; Text = text; TextChanged?.Invoke(this, Text); return(Task.CompletedTask); }