SyntaxEditor includes a powerful view search model that is layered on top of the low-level search model found in the text framework.
Understanding the View Search Model vs. the Low-Level Search Model
Before diving into this topic any further, it is essential that you understand the information presented in the Low-Level Searching Operations topic. That topic describes the core search object model and its capabilities. Most of the same types described in that topic are used in the "view" search model.
The "view" search model layers itself on top of the core model and provides some extended functionality. Most of the extended functionality deals with manipulating the search operations based on the view's selection and updated the selection when appropriate.
In general, the rule of thumb is: if you are going to search a document that is open within a SyntaxEditor control, use the "view" search model. If you are going to search a document that is not open in a SyntaxEditor control, use the low-level search model.
Accessing the View Search Model
The "view" search model is accessed via the IEditor
Since the view search model is accessed for a particular view, it interacts with the owner view's selection.
Editor Search Options
The IEditor
This view search model options interface adds a Scope property, which is an enumeration value of type Editor
The Editor
Search Result Sets
Each search method returns an ISearch
Performing a Find Next Operation
A "find next" operation can be performed like this:
Performing a Replace Next Operation
A "replace next" operation can be performed like this:
Performing a Replace All Operation
A "replace all" operation can be performed like this: