The Extract Interface refactoring allows you to define a new interface from selected class or interface members. It also allows you to
select already inherited interfaces and effectively make the new interface inherit from them.
Executing the refactoring results in a new interface been created by Telerik® JustCode™ containing the selected members from the target class. There is an option to create a file for the new interface with the name of the file.
You can use the refactoring to define an empty interface by not selecting any member.
It is allowed to select members regarding their visibility and any not public members will automatically have their visibility converted to public after the refactoring completes.
Supported: C#, VB.NET
Not relevant: ASP.NET, XAML, HTML
The command is not available for static and generic types.
To extract an interface
Select the class or interface identifier you want to extract.
Press Alt+Insert. From the pop-up menu select Extract Interface.
Enter a name for the new interface.
Choose if the interface will be created in a new file.
Select a one or more members to be extracted or leave empty for a new empty interface.
Press Enter to finish or Esc to abort the operation.
The result is
To extract a interface you can also navigate on the main menu. Choose JustCode | Refactor |
Extract Interface, or through Visual aids menu.