private void Brainf_ckEditBox_SelectionChanging(RichEditBox sender, RichEditBoxSelectionChangingEventArgs args)
        {
            _SelectionStart  = args.SelectionStart;
            _SelectionLength = args.SelectionLength;

            IsTextSelected = args.SelectionLength > 0;
        }
Example #2
0
        private void RichEditBox_SelectionChanging(RichEditBox sender, RichEditBoxSelectionChangingEventArgs args)
        {
            var selection = TextDocument.Selection;

            if (selection.Type != SelectionType.InsertionPoint && selection.Type != SelectionType.Normal)
            {
                return;
            }

            var range = selection.GetClone();

            range.Expand(TextRangeUnit.Link);
            lock (_tokensLock)
            {
                if (!_tokens.ContainsKey(range.Link))
                {
                    return;
                }
            }

            ExpandSelectionOnPartialTokenSelect(selection, range);
        }
 private void OnCodeEditorSelectionChanging(RichEditBox sender, RichEditBoxSelectionChangingEventArgs e)
 {
     previousSelection = currentSelection;
     currentSelection  = new TextSpan(e.SelectionStart, e.SelectionLength);
 }
Example #4
0
 void IRichEditBoxSelectionChangingEventArgsResolver.Cancel(RichEditBoxSelectionChangingEventArgs e, bool cancel) => e.Cancel = cancel;
Example #5
0
 bool IRichEditBoxSelectionChangingEventArgsResolver.Cancel(RichEditBoxSelectionChangingEventArgs e) => e.Cancel;
Example #6
0
 int IRichEditBoxSelectionChangingEventArgsResolver.SelectionLength(RichEditBoxSelectionChangingEventArgs e) => e.SelectionLength;
Example #7
0
 int IRichEditBoxSelectionChangingEventArgsResolver.SelectionStart(RichEditBoxSelectionChangingEventArgs e) => e.SelectionStart;
Example #8
0
 /// <summary>
 /// Sets a value that indicates whether the selection operation should be canceled.
 /// </summary>
 /// <param name="e">The requested <see cref="RichEditBoxSelectionChangingEventArgs"/>.</param>
 /// <param name="cancel"><c>true</c> to cancel the selection operation; otherwise, <c>false</c>. The default is <c>false</c>.</param>
 public static void Cancel(this RichEditBoxSelectionChangingEventArgs e, bool cancel) => Resolver.Cancel(e, cancel);
Example #9
0
 /// <summary>
 /// Gets a value that indicates whether the selection operation should be canceled.
 /// </summary>
 /// <param name="e">The requested <see cref="RichEditBoxSelectionChangingEventArgs"/>.</param>
 /// <returns><c>true</c> to cancel the selection operation; otherwise, <c>false</c>. The default is <c>false</c>.</returns>
 public static bool Cancel(this RichEditBoxSelectionChangingEventArgs e) => Resolver.Cancel(e);
Example #10
0
 /// <summary>
 /// Gets the length of the text selection.
 /// </summary>
 /// <param name="e">The requested <see cref="RichEditBoxSelectionChangingEventArgs"/>.</param>
 /// <returns>The length of the text selection.</returns>
 public static int SelectionLength(this RichEditBoxSelectionChangingEventArgs e) => Resolver.SelectionLength(e);