Batch/Automatically apply refactoring pattern(s) to entire solution

I am trying to cleanup/refactor a legacy C# solution and am therefore exploring options how certain refactorings cound be applied for the entire solution.

As an example, I have the following case: 
Classes contain getXXX and setXXX pairs (since code was apparently migrated from another language like Java). Some of these basically encapsulate simple fields, others encapsulate more logic. 
Most classes also contain "wrappers" for the property which merely call the methods in their getters/setters. 
----------- 

class PropertyRefactoringExample 

private int someProperty;

public int getSomeProperty() 

return someProperty; 
}

public void setSomeProperty(int someProperty) 

this.someProperty = someProperty; 
}

public int SomeProperty 

get { return getSomeProperty(); } 
set { setSomeProperty(value); } 


----------- 
The desired refactoring would (in multiple steps, iterations): 
- refactor the getXXX and setXXX methods to a property. All code calling the methods should instead be using the property. There is a refactoring for that, but it misses the existing wrapper. The wrapper would need to be replaced/removed. 
- as an optional follow-up step, convert the property to an auto-property (if applicable)

I can manually do this for a class and a property. However I have 100+ classes with several hundred properties. How could this be automated?

I am open for all options - command line, powershell, VBA, even VISX-development

Please sign in to leave a comment.