Home > Components > DXCore Components – SearcherProvider

DXCore Components – SearcherProvider

June 22nd, 2011

The SearcherProvider DXCore component returns a custom searcher that is used for renaming in the Rename refactoring, or inside the source code navigation features, such as Tab to Next Reference.

The control doesn’t exist on the Visual Studio toolbox by default. You have to manually add it by selecting the “Choose Items…” in the context menu of the Visual Studio toolbox:

DXCore SearcherProvider Choose Items

and locating the SearcherProvider control in the list:

DXCore Searcher Provider Choose Toolbox items

Now, you can drop the Searcher Provider onto your plug-in design surface from Visual Studio Toolbox:

DXCore SearcherProvider on the Toolbox

It’s not a visual control, only its properties and events should be tweaked. Here’s the Properties window, containing available properties, their categories and default values:

DXCore Searcher Provider events

and the Events list:

DXCore Searcher Provider events

The SearcherProvider component is located in the “DevExpress.CodeRush.Core” assembly. It is derived from the “ProviderBase” type:

DXCore Searcher Provider hierarchy

Here’s a list of properties in alphabetical order with descriptions:

Property name

Description

ActiveFileOnly If true, the scope for this searcher provider is the currently active file only.
Description Text, describing the purpose or behavior of this plug-in extension. This text may appear inside the User Guide, configuration UI, or the Aboutbox.
DisplayName The text name that identifies this extension. This text may appear inside the User Guide, configuration UI, or the About box.
ProviderName The name of this provider.
Register If true, this extension will be available to the DXCore. Otherwise, it will be hidden.
UseForNavigation If true, this searcher provider will be used in the navigation features, e.g. “Tab to Next Reference” feature.
UseForRenaming If true, this searcher provider will be used in the renaming process using the “Rename” refactoring.

Events:

Event name

Description

CheckAvailability Occurs when the availability of this provider in the current context is being tested. Handle this event to indicate under what conditions this provider is available or recommended.
GetRangeToSelect Handle this event to specify the source code range that should be selected after the search is complete.
LanguageSupported Handle this optional event if you want to restrict your context to one or more programming languages. If you do not handle this event, the DXCore makes your context available in all programming languages.
SearchPreviewReferences Handle this event to provide references necessary for a code preview.
SearchReferences Handle this event to provide resulting references.

See the “How to implement the Sync Edit feature from Delphi IDE inside Visual Studio IDE using DXCore” topic to learn more on how to use this DXCore component.

—–
Products: DXCore
Versions: 11.1 and up
VS IDEs: any
Updated: Jun/22/2011
ID: D094

Similar Posts: