views:

113

answers:

3

Hi there,

In resharper is it possible to force an update of an interface?

basically i have a class that inherits from an interface but this class is constantly changing so i need to reflect the changes in the Interface otherwise VS complains that i am not implementing something as the signature of the method has changed.

I was wondering if there is a way in resharper to say "Update this class with its Interface" ?

Any ideas?

Thanks

A: 

If you use ReSharper to modify the method, it can/will also modify the interface definition.

For instance, if you use ReSharper's Rename functionality on the method, the interface definition of it will get renamed. Additionally, if you use ReSharper's Change Signature functionality on the method, it asks you if you want to do the refactoring on the interface as well.

adrianbanks
A: 

If you're changing signature of a method defined in an interface, change it via Refactor - Change Signature.... ReSharper will then ask you if you want to change signature of an interface method.

Other than that, I cannot imagine how would ReShaper know what and how to update.

Anton Gogolev
+1  A: 

Letting the interface follow the implementation is the exact wrong direction. First, you should define in your interface, what you need, then implement it in the backing class. You shouldn't expect a tool to support undesired workflows instead...

If you go the right way, R# will give you all support you ever need: You can refactor existing methods via Refactor|Rename..., Refactor|Change Signature... and Implement Members.

Thomas Weller