Document.FindReplace.FindAll does not use SearchInSelection

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Chris Morris
Version: 4.0.0271
Platform: .NET 2.0
Environment: Windows XP (32-bit)
When selecting partial text in the Syntax editor and using the FindAll method with the SearchInSelection property set to true, it returns all the found instances in the Editor not only those in the currently selected text.
FindReplaceOptions findReplaceOptions = new FindReplaceOptions();

findReplaceOptions.FindText = "AA";
findReplaceOptions.SearchInSelection = true;

FindReplaceResultSet findResult = editor.Document.FindReplace.FindAll(findReplaceOptions);
eg. Code in Syntax Editor

line 0: AA
line 1:
line 2: AA
line 3: AA

Where lines 2 and 3 are only selecetd the findResult would find lines 0, 2,3

Same bug for Document.FindReplace.MarkAll.

Comments (2)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Chris,

The Document.FindReplace model doesn't pay attention to selections since those are view-related. The EditorView.FindReplace model does pay attention to selections.

FindAll is only on the Document one I believe, and therefore return everything in the document. You'd have to filter down the results yourself based on the selection offset range.

However I think MarkAll is on the EditorView model as well.

Actipro Software Support

Posted 16 years ago by Chris Morris
Thanks for the quick response.

Yes MarkAll is available on the EditorView but FindAll method is missing.

Workaround to use editor.Document.FindReplace.FindAll(FindReplaceOptions options, TextRange offsetTextRange) and set the offsetTextRange to the selected text in the current view.

[Modified at 05/01/2008 02:42 AM]
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.