ReSharper Web Help

The Extract Superclass refactoring allows to extract certain members from a selected class to a new superclass.

ReSharper analyses the selected class and detects the superclasses and interfaces it inherits from, as well as its members and methods that can be transferred to the new superclass. The original class will be made to inherit from the new superclass.

To extract a superclass
  1. In the editor, position the caret at the declaration of the class that you want to extract a superclass from.
  2. Choose ReSharper | Refactor | Extract Superclass. The Extract Superclass wizard opens:
    Extract Superclass refactoring
  3. In the Name of new class text box, type a name for the new superclass.
  4. Click Place beside or Place in another file to define the physical location of the new superclass.
  5. In the list of members, select members that you want to transfer to the new superclass.
  6. To make/keep individual members abstract, select corresponding Make Abstract check boxes where available.
  7. To extract all public members of the current class, click All Public.
  8. If you selected members that reference other members, the latter are highlighted with red, as shown in figure above. Click Dependent to resolve the conflict, i.e. to select any members that depend on the currently selected members.
  9. Click Next. If no conflicts are found, the refactoring will be applied immediately.

See Also