如何更改在Visual Studio 2015年的默认搜索错误 [英] How to change default error search in Visual Studio 2015

查看:158
本文介绍了如何更改在Visual Studio 2015年的默认搜索错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而我在的Visual Studio 2015CTP写我的代码我得到了如下错误中ErrorList窗口:

While I was writing my code in Visual Studio 2015CTP I got error as below in ErrorList window:

错误CS0117控制台不包含ReadKey

Error CS0117 'Console' does not contain a definition for 'ReadKey'

通过点击 CS0117 它重定向我的默认浏览器,并使用Bing搜索。由于大部分我们使用谷歌作为搜索引擎的时候,有没有什么办法让谷歌作为默认搜索,而不是冰。

By clicking on CS0117 it redirects me to default browser and searches using Bing. As most of the time we use Google as a search engine, is there any way to make Google as a default search instead of Bing.

推荐答案

简单地重定向搜索服务提供商可能不会工作。我们产生量身定做与Bing的边一个专门的搜索引擎的工作搜索字符串。传递相同的搜索字符串到其他搜索引擎可能会为贫困的结果。

Simply redirecting the search provider probably won’t work. We generate a search string that is tailored to work with a specialized search engine on the Bing side. Passing that same search string to another search engine probably will give poor results.

您需要做什么,相反,是定义你自己的处理程序的帮助活动。这将提取错误本身的相关信息(如错误代码,语言等)来创建一个通用搜索,将与您所选择的供应商合作。如果这个处理器自带的默认处理程序之前,那么你就可以处理该事件,并防止默认应(Bing)从执行搜索

What you will need to do, instead, is define your own handler for the help event. This would extract relevant information from the error itself (such as error code, language, etc.) to create a generic search that would work with the provider of your choice. If this handler comes before the default handler, then you can handle the event and prevent the default (bing) search from executing.

的接口你的需要实现的是:

The interfaces your need to implement are:

ITableControlEventProcessorProvider

这是一个MEF出口,应具有以下属性:

This is a MEF export and should 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

有可能是最好的定义是从
TableControlEventProcessorBase (它提供了所有事件的缺省的/无操作实现),然后明确地处理的 PreprocessNavigateToHelp(ITableEntryHandle项,TableEntryEventArgs E)事件:

It is probably best to define a class that is derived from TableControlEventProcessorBase (which provides default/no-op implementations for all of the events) and then explicitly handle the PreprocessNavigateToHelp(ITableEntryHandle entry, TableEntryEventArgs e) event by:


  1. 提取项中的有用数据

  2. 创建通用搜索到你选择

  3. 的搜索服务提供商打开浏览器

  4. 的实例设置 e.Handled 为true(防止其他帮助处理器从执行)。

  1. extracting the useful data from entry
  2. creating a generic search to the search provider of your choice
  3. opening an instance of the browser
  4. setting e.Handled to true (to prevent the other help handlers from executing).

这篇关于如何更改在Visual Studio 2015年的默认搜索错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆