Refactoring: Extract method into a class

1.2k Views Asked by At

Is there a tool that would allow me to extract methods into classes without much manual work? I need this on massive scale, 100's of methods.

2

There are 2 best solutions below

0
On

There is an Extract class refactoring in ReSharper 7.0. You can choose which methods would go into extracted class. But you cannot extract 100 classes at once by clicking one button. I doubt that there is a tool that can do this. But you can always try to write a plugin for ReSharper for this task.

0
On

Here is how i am able to do it using resharper: Place the Caret in the method name, bring up the resharper menu (Ctrl+Shift+R), select "Move to another Type" and this will open a dialog that will help you to locate the "transfer to location".

Optionally, if you are using resharpers default shortcuts in visual studio, just place the caret in the method name and press F6.