How to rename a class the same as a file name?

I need to rename a class the same name as the file without the extension. For example, If I copied a class to the same folder it would create a "Copy of Class.cs". I would then rename the file to "DifferentClass.cs" open the file, and right-click, select 'Refactor -> Rename...', then choose 'Rename same as file name.'. However, there is no 'Rename same as file name.' that I am aware of. Is this possible with the latest version of Resharper?

2 comments
Comment actions Permalink

Hello Bruce,

You may use Context Action to easily rename the file to match class name. I've attached a screenshot for a reference.
Hope this helps.

Thank you.



Attachment(s):
screen412.png
0
Comment actions Permalink

And there is a plugin available that will go the other way and rename a class based on the filename:

http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/resharper-plugin-rename-class-to

Thanks
Matt

0

Please sign in to leave a comment.