예제 #1
0
 private void TextEditor_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
 {
     if (args.IsContentChanging)
     {
         _documentLinesCache = null;
     }
 }
예제 #2
0
 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);
                }
            }
        }
예제 #4
0
 private void TextChanged(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
 {
     if (textsaving == false)
     {
         textchanged = true;
     }
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
        private void MarkdownRichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
        {
            if (!args.IsContentChanging)
            {
                return;
            }

            ApplySyntaxHighlight();
        }
예제 #7
0
 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;
     }
 }
예제 #8
0
 private void TextEditor_TextChanging(object sender, RichEditBoxTextChangingEventArgs args)
 {
     if (!(sender is TextEditor textEditor) || !args.IsContentChanging)
     {
         return;
     }
     if (textEditor.Saved)
     {
         MarkTextEditorSetNotSaved(textEditor);
     }
 }
예제 #9
0
 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);
            }
        }
예제 #11
0
        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 = "";
            }
        }
예제 #13
0
        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;
                }
            }
        }
예제 #14
0
 /// <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);
예제 #15
0
        private void Article_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
        {
            sender.Document.GetText(TextGetOptions.None, out articleTxt);

            System.Diagnostics.Debug.WriteLine("article: " + articleTxt);
        }
예제 #16
0
 async private void XEditBox_TextChanging(object sender, RichEditBoxTextChangingEventArgs e)
 {
     this.RetrieveAndColourTokens();
     await this.RetrieveAndColourTokensWithDelay();
 }
예제 #17
0
 private void TextField_TextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
 {
     CheckMessageBoxEmpty();
 }
예제 #18
0
 bool IRichEditBoxTextChangingEventArgsResolver.IsContentChanging(RichEditBoxTextChangingEventArgs e) => e.IsContentChanging;
예제 #19
0
 private void OnTextChanging(RichEditBox sender, RichEditBoxTextChangingEventArgs args)
 {
     _fromTextChanging = true;
 }