private void Brainf_ckEditBox_SelectionChanging(RichEditBox sender, RichEditBoxSelectionChangingEventArgs args) { _SelectionStart = args.SelectionStart; _SelectionLength = args.SelectionLength; IsTextSelected = args.SelectionLength > 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); }
void IRichEditBoxSelectionChangingEventArgsResolver.Cancel(RichEditBoxSelectionChangingEventArgs e, bool cancel) => e.Cancel = cancel;
bool IRichEditBoxSelectionChangingEventArgsResolver.Cancel(RichEditBoxSelectionChangingEventArgs e) => e.Cancel;
int IRichEditBoxSelectionChangingEventArgsResolver.SelectionLength(RichEditBoxSelectionChangingEventArgs e) => e.SelectionLength;
int IRichEditBoxSelectionChangingEventArgsResolver.SelectionStart(RichEditBoxSelectionChangingEventArgs e) => e.SelectionStart;
/// <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);
/// <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);
/// <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);