The Extract Interface refactoring allows users to quickly create a new interface based on a selected interface or abstract class. ReSharper analyses the selected interface or abstract class and detects the members and methods that can be converted. After extraction, the original interface or abstract class inherits from the new interface.
To extract an interface
- In the editor, place the caret at the name of interface or abstract class to be converted.
- Do one of the following:
- On the main menu, click ReSharper | Refactor | Extract Interface.
- Right-click the type name and select Refactor | Extract Interface in the context menu.
- Press Ctrl + Shift + R, and then select Extract Interface.
The Extract Interface dialog box opens.

- Specify the new interface name.
- Specify the namespace for the new interface.
- Select Include members from base classes if you want the new interface to contain the members of base classes of the interface or abstract class used for extraction.
- In the list, select the checkboxes for those members that will be used to form the new interface. Use Select All to quickly select all members.
- Click Continue. If no conflicts are found, the extraction is performed immediately.
See Also
Refactoring Code