There are several products available to add additional refactoring options in Visual Studio 2005 and 2008, some of the best are Refactor! Pro and Resharper .
Regarding the removal method, the canonical book of Refactoring contains a description of how to do this gradually.
Personally, I follow a pattern of something along these lines (suppose that compilation and launch of unit tests occurs between each step):
- Create a new method
- Delete the body of the old method, change it to call the new method
- Find all the references to the old method (right-click the name of the method and select "Find all references"), replace them with calls to the new method.
- Mark the old method as [Deprecated] (calls to it now display as warnings during build)
- Delete old method
source share