开发者

Replace Unnecessary Fully Qualified Types and add usings Across all Classes

I'm trying to get rid of a ton of unnecessary fully qualified types and instead throw in a using at the top of these classes.

I am not sure if there is some kind of batch that would go out and do this for me. Right now I have to use ReSharper and erase the redundant portion of a type and then of course ReSharper asks to throw in the missing using and that's how I am going through each class manually cleaning these up.

There's got to be a more automated way wh开发者_如何学运维ere I can run some process to go through all the project in this solution and do this for me ..just like I'm having to do manually with each line of code with ReSharper?


You should use Code Cleanup. To run on a single file, go to ReSharper | Tools | Cleanup code, select Full cleanup or create your own profile with Optimize 'using' directives and Shorten qualified references turned to Yes. Maybe Remove code redundancies should be turned to Yes also.

You can run Code cleanup on several files. To do it, select necessary files in Solution explorer, press right mouse button and run Code cleanup from popup menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜