Just redirecting the search provider probably won't work. We create a search bar designed to work with a specialized search engine on the Bing side. Passing the same search string to another search engine is likely to give poor results.
Instead, you will need to define your own handler for the help event. This will allow you to extract the necessary information from the error itself (for example, error code, language, etc.), in order to create a general search that will work with the provider of your choice. If this handler is before the default handler, you can handle the event and prevent the default search (bing) from occurring.
Interfaces required for implementation:
ITableControlEventProcessorProvider
This is an MEF export and must have the following attributes:
[Export(typeof(ITableControlEventProcessorProvider))] [DataSourceType(StandardTableDataSources.ErrorTableDataSourceString)] [DataSource(StandardTableDataSources.AnyDataSourceString)] [ManagerIdentifier(StandardTables.ErrorsTableString)] [Name("my custom event processor name")] [Order(Before=Priority.Default)]
ITableControlEventProcessor
It is probably best to define a class that is derived from TableControlEventProcessorBase (which provides a default / no-op implementation for all events) and then explicitly processes the PreprocessNavigateToHelp(ITableEntryHandle entry, TableEntryEventArgs e) event:
- extracting useful data from a record
- Create a general search for the search provider of your choice
- opening browser instance
- setting
e.Handled to true (to prevent other handlers from executing).
source share