views:

21

answers:

1

Given:

  • I have an interface.
  • I have only class that implements that interface.

Question:

With Resharper 4.5 - How can I discard that interface and change all references to the only implementation?

+1  A: 

There doesn't seem to be a way to do this "automagically" in one step.

What I would do in this situation is the following:

  1. "Safe-Delete" (Ctrl-R,D [VS] or Alt-Del [IDEA]) the interface, leaving the code with compilation errors.
  2. Navigating to the next error using (Alt-Shift-PgDn [VS] or Alt-F12 [IDEA]).
  3. Pressing Alt-Enter and selecting "Change all IYourInterfaceName" and typing the concrete class name.

Hope that helps.

hmemcpy