Structural Search and Replace is your friend here. You get to it through ReSharper | Find | Search with Pattern....
- Define a placeholder of type
X, name it TX.
- Make your Find pattern
$TX$
- Specify to "Look in" "Project"
- As a check, carry out the search - you should see all the usages of
X
- Click the Replace toggle button
- Make the Replace pattern the fully-qualified name of
Y
- Click Replace
ReSharper will show you all the mentions of X it wants to replace - ensure the checkbox at the top of the tree is checked, then click Replace.
edit
It is indeed by using a type placeholder in our Find pattern that ensure that only references to the type X, rather than anything else named X, are renamed.
If you would prefer to end up with
using A.B.C;
/* later */
Y obObject = ...
rather than
A.B.C.Y myObject
I think you can achieve this through:
- In
ReSharper | Options, Tools | Code Cleanup, define a new profile which has just "Optimize 'using' directives" checked
- In
ReSharper | Options, Languages | C# | Namespace Imports add A.B.C to "Namespaces that should always be imported`
- Run
ReSharper | Tools | Cleanup Code using the profile you just defined
- Tidy up by removing
A.B.C from the namespaces list you added it to
although this will also clean up all other usings, which might make the version control diff a bit larger than you want.