Creating an interface from a huge class using resharper

心不动则不痛 提交于 2019-12-12 08:39:25

问题


I have a very big class with lots of methods, is it possible to build an interface from this class using Resharper?


回答1:


Yes.

My shortcut is Ctrl + Shift + R to bring up the refactoring options. Doing this on the class name allows you to" Extract Interface..."

Optionally, you can choose from the menu > ReSharper > Refactor > Extract Interface...




回答2:


Uh, maybe I'm missing something here (I've never used resharper) but you can extract an interface from a class using the standard VS IDE refactoring tools (at least you can in 2008). Right click the class, select 'Refactor' and then 'Extract Interface'. This will bring up a dialog box where you can select which properties to include.



来源:https://stackoverflow.com/questions/1268424/creating-an-interface-from-a-huge-class-using-resharper

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