Resharper change object to interface

I have an updated third-party library, and there used to be a Foo object, and now its IFoo interface

what is the best way to change all applications and declarations of foo to ifoo

I tried to do Find / Replace, but it also affected FooBar on IFooBar (which I don't want)

thoughts?

+4
source share
3 answers

It definitely works with R # 4.5.

  • Right-click your Foo class.
  • Choose Refactor / Use Base Type where possible ..
+6
source

As others claim, ReSharper can do what you ask for.

As an aside, be sure to get and print the ReSharper Keyboard shortcuts. There are two options: the Visual Studio schema and the IDEA schema (most of the guys I know use the IDEA schema).

But there are only two key combinations that you really need to know: Refactor this: Ctrl + alt + R Go from here: Ctrl + alt + G or Alt + '(depending on the keyboard layout)

This will give you many of the most valuable ReSharper features.

+1
source

You can right-click on the Foo link and select "Refactor This" β†’ Rename, and it will change all the links that it can find. Never do this with a third-party library, but work elsewhere.

0
source

All Articles