private void TextEditor_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (args.IsContentChanging) { _documentLinesCache = null; } }
private void Main_RichEditBox_OnTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (FocusManager.GetFocusedElement() == main_RichEditBox) { main_RichEditBox.Document.Selection.CharacterFormat.ForegroundColor = ViewModule.FontColorBrush?.Color ?? Colors.Black; } }
private async void OnCodeEditorTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs e) { if (e.IsContentChanging && previousSelection != currentSelection) { HighlightSearchBoxMatches(); CodeEditor.TextDocument.GetText(TextGetOptionsFromNewLineMode(ViewModel.NewLineMode), out string wholeText); string?previousText = ViewModel.CurrentText; if (wholeText != previousText) { ViewModel.CurrentText = wholeText; int start = Math.Min(previousSelection.Start, currentSelection.Start); ITextRange range = CodeEditor.Document.GetRange(start, currentSelection.End); range.GetText(TextGetOptionsFromNewLineMode(ViewModel.NewLineMode), out string text); TextSpan span = GetAdjustedTextSpan(TextSpan.FromBounds(start, previousSelection.End), previousText, ViewModel.NewLineMode, true); TextChange textChange = new TextChange(span, text); await ViewModel.ApplyChangesAsync(textChange, null); } } }
private void TextChanged(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (textsaving == false) { textchanged = true; } }
private void Editor_TextChanging(object sender, RichEditBoxTextChangingEventArgs e) { // Fix bug where selected text would get colored when editor loses focus if (FocusManager.GetFocusedElement() == editor) { editor.Document.Selection.CharacterFormat.ForegroundColor = currentColor; } }
private void MarkdownRichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (!args.IsContentChanging) { return; } ApplySyntaxHighlight(); }
private void MyRichEditBox_TextChanging(object sender, RichEditBoxTextChangingEventArgs e) { // Hitting control+b and similiar commands my overwrite the color, // which result to black text on black background when losing focus on dark theme. // Solution: check if text actually changed if (e.IsContentChanging) { myRichEditBox.Document.Selection.CharacterFormat.ForegroundColor = currentColor; } }
private void TextEditor_TextChanging(object sender, RichEditBoxTextChangingEventArgs args) { if (!(sender is TextEditor textEditor) || !args.IsContentChanging) { return; } if (textEditor.Saved) { MarkTextEditorSetNotSaved(textEditor); } }
private void OnTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { try { this.HighlightLinks(); } catch (Exception ex) { TrackingManagerHelper.Exception(ex, "Exception in CustomRichEditBox.OnTextChanging"); } }
private void RichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (_ignoreChange || !args.IsContentChanging) { return; } lock (_tokensLock) { this.CreateSingleEdit(ValidateTokensInDocument); } }
private void RichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (_ignoreChange || !args.IsContentChanging) { return; } _ignoreChange = true; ValidateTokensInDocument(); TextDocument.EndUndoGroup(); TextDocument.BeginUndoGroup(); _ignoreChange = false; }
private void RichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (!String.IsNullOrEmpty(subscriptText)) { sender.Document.GetText(Windows.UI.Text.TextGetOptions.None, out string text); text = text.Replace("\r", "").Remove(sender.Document.Selection.StartPosition - 1, 1); var startPosition = sender.Document.Selection.StartPosition; sender.Document.SetText(Windows.UI.Text.TextSetOptions.None, text + subscriptText); sender.Document.Selection.StartPosition = startPosition; subscriptText = ""; } }
private void OnTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4)) { ContentChanged = args.IsContentChanging; } else { ContentChanged = (CoreText.Text.Length > 1 && Document.CanUndo()); } if (TextSaveState == SaveState.OpenedFile && !ContentChanged) { TextSaveState = SaveState.TextIsUnchanged; ContentChanged = false; } else { if (ContentChanged) { TextSaveState = SaveState.TextIsChanged; } } }
/// <summary> /// Gets a value that indicates whether the event occurred due to a change in the text content. /// </summary> /// <param name="e">The requested <see cref="RichEditBoxTextChangingEventArgs"/>.</param> /// <returns><c>true</c> if a change to the text content caused the event; otherwise, <c>false</c>.</returns> public static bool IsContentChanging(this RichEditBoxTextChangingEventArgs e) => Resolver.IsContentChanging(e);
private void Article_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { sender.Document.GetText(TextGetOptions.None, out articleTxt); System.Diagnostics.Debug.WriteLine("article: " + articleTxt); }
async private void XEditBox_TextChanging(object sender, RichEditBoxTextChangingEventArgs e) { this.RetrieveAndColourTokens(); await this.RetrieveAndColourTokensWithDelay(); }
private void TextField_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { CheckMessageBoxEmpty(); }
bool IRichEditBoxTextChangingEventArgsResolver.IsContentChanging(RichEditBoxTextChangingEventArgs e) => e.IsContentChanging;
private void OnTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args) { _fromTextChanging = true; }