public override bool RemoveSelection(int selectionNum) { if (textProvider.SupportedTextSelection == SupportedTextSelection.Single || selectionNum == 0) { if (selectionNum < 0 || selectionNum >= NSelections) { return(false); } int offset = (CaretProvider != null ? CaretProvider.CaretOffset : 0); ITextRangeProvider textRange = GetTextRange(offset, offset); textRange.Select(); return(true); } int startOffset, endOffset; string selection = GetSelection(selectionNum, out startOffset, out endOffset); if (selection != null && selection != String.Empty) { ITextRangeProvider textRange = GetTextRange(startOffset, endOffset); try { textRange.RemoveFromSelection(); } catch (InvalidOperationException e) { Log.Debug(e); return(false); } return(true); } return(false); }
public void RemoveFromSelection() { provider.RemoveFromSelection(); }