Renaming duplicate properties using Resharper
Sep 19
2011
You might come across some code like this
public bool IsOpen { get; set; }
public bool Open { get; set; }
Don't question the why - just accept its evolved and requires cleaning up.
Assume both are used in many places (otherwise you can do a manual refactor easily)
If you use Resharper to Rename (Ctrl-R,R) IsOpen
to Open
Resharper will only replace the calls in that class and external calls wont be changed (ie it doesnt work)
The trick is to comment out the property you want to keep:
//public bool IsOpen { get; set; }
public bool Open { get; set; }
Now you can Rename Open
and Resharper will do its magic.
No new comments are allowed on this post.
Comments
No comments yet. Be the first!