IIncrementalSearch Interface

IIncrementalSearch Interface

 

Defines an incremental search operation.

Namespace:   Microsoft.VisualStudio.Text.IncrementalSearch
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

No code example is currently available or this language may not be supported.

NameDescription
System_CAPS_pubpropertyIsActive

Determines whether an incremental search is in process.

System_CAPS_pubpropertySearchDirection

Gets or sets the direction of the incremental search.

System_CAPS_pubpropertySearchString

Gets or sets the current search term.

System_CAPS_pubpropertyTextView

Gets the ITextView associated with this search.

NameDescription
System_CAPS_pubmethodAppendCharAndSearch(Char)

Extends the current term being searched for by one character. If a new term is matched, it is selected. The selection can be used to access the match.

System_CAPS_pubmethodClear()

Clears the existing search term without changing the selection.

System_CAPS_pubmethodDeleteCharAndSearch()

Removes the last character of the current search term and updates the search results based on the new term.

System_CAPS_pubmethodDismiss()

Terminates an incremental search operation.

System_CAPS_pubmethodSelectNextResult()

Selects the next result in an incremental search operation. The matched term will be selected.

System_CAPS_pubmethodStart()

Starts an incremental search operation, and marks the position of the caret as the starting position for the search.

The IIncrementalSearch interface is associated with a ITextView.

After the Start method is called, the current caret position is marked as the start of the search. If a matching term is found, it is selected and the caret is moved to the end of the selected word.

The direction of the search is set to forward by default, although this setting can be changed with the SearchDirection property.

The AppendCharAndSearch and DeleteCharAndSearch operations can be used to change the search term.

Every search operation returns an IncrementalSearchResult, which includes information about the search, such as whether the search looped around the start or end of the buffer, whether the search looped around the starting position of the search, and whether the item was found. It is the responsibility of the caller to pass this information to the end user.

Incremental search performs its search on the text snapshot of the ITextView. As a result, if the result falls within a collapsed outlining region, the region will be expanded before the result is selected.

Return to top
Show:
© 2016 Microsoft