Add method to existing interface

2 posts, 0 answers
  1. Philippe HERTZOG
    Philippe HERTZOG avatar
    3 posts
    Member since:
    Oct 2012

    Posted 14 Jul 2014 Link to this post

    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
  2. Svetlozar
    Admin
    Svetlozar avatar
    271 posts

    Posted 17 Jul 2014 Link to this post

    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.

     
  3. DevCraft banner
Back to Top