VS Intellisense: can you hide extension methods?

天大地大妈咪最大 提交于 2019-12-01 02:56:30

Not that I'm aware of - but one thing you might want to do is get rid of the using directive for System.Linq. At that point the extension method won't be accessible, and I believe it won't be offered by Intellisense.

Obviously that's no good if you want to use LINQ from one bit of code in a class, but not in another - but for classes which aren't using LINQ at all, it might help you.

In theory you could do this with the appropriate decorator attribute*, but googling this it seems it's bugged, with the fix awaiting a service pack presumably.

* [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]

Perhaps you could try using something like resharper which filters the list of methods as you type. I find this helps me to quickly get to what I need. And it will do so without hiding useful extention methods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!