This is a migrated thread and some comments may be shown as answers.

Add method to existing interface

1 Answer 173 Views
Refactorings
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Philippe HERTZOG
Top achievements
Rank 1
Philippe HERTZOG asked on 14 Jul 2014, 03:14 PM
Hello,

I'm using JustCode (version 2012...1128.2) with visual studio 2012.

I have a class that implements an interface. The class and the interface live in different folders and namespaces.

I now add a new method to the class and would like to add it to the interface. I use the ExtractInterface refactoring and select the new method. But the choices I have is :
1. create the interface in the class
2. Create a new file for the interface : but this file is created in the class folder and not in the interface folder.

Is there a way to add a method to the existing interface from a class that implements it?

Regards

1 Answer, 1 is accepted

Sort by
0
Svetlozar
Telerik team
answered on 17 Jul 2014, 12:10 PM
Hi,

Thank you for your feedback!

Pull Members to Base Type is the refactoring that can add members to an existing interface. Just navigate to the added method and execute Pull Members to Base Type. If the base type (including interfaces) is only one, the member will be added to it. If there is more than one, a dialog will prompt you to which type you wan to pull.

If you have any other questions, please don't hesitate to write back!

Regards,
Svetlozar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Refactorings
Asked by
Philippe HERTZOG
Top achievements
Rank 1
Answers by
Svetlozar
Telerik team
Share this question
or