The Pull Members Up refactoring helps pull type members from an inheritor up the inheritance hierarchy to a base type. This operation is useful when you want to generalize the behavior of the superclass.
ReSharper analyzes all members in the current class and makes the list of members that you can move to a superclass or interface. Before completing the refactoring, ReSharper also checks for possible conflicts, for example, whether the members you are trying to move to the base class will be accessible in the destination type.
Reverse functionality is available with the
- Position the caret at a member of the class that you want to pull members up from.
- Choose ReSharper | Refactor | Pull Members Up. The Pull Members Up wizard opens:
- Select a destination base type from the list of available types at the top of the wizard.
- In the Select members list, select members of the current type
that you want to pull up. Optionally, click one of the following buttons:
- All Public to select all public members of the current type.
- Dependent to select members that are referenced by any other previously selected members.
- For any member, select Make abstract (if applicable) to create an abstract member in the selected base type and leave its implementation in the current type.
- Click Next. If no conflicts are found, the refactoring is performed immediately.