ReSharper 2020.2 Help

Extract Members to Partial refactoring

ReSharper | Refactor | Extract Members to Partial…

This refactoring helps you move selected type members to another part of a partial type. If necessary, ReSharper will make the current type partial, create a new part of this type and a file for it — all in one go. All necessary imports are moved with the moved members.

Make a type partial and move selected members there

  1. Select a type or a member in one of the following ways:

    • In the editor, set the caret at the name of a type or a member.

    • Select a type or a member in the File Structure window.

    Or, alternatively, select one or several members you want to extract in the editor or in a tool window or set the caret at a region with members that you want to extract.
  2. Do one of the following:

    • Press Control+Shift+R and then choose Extract Members to Partial

    • Right-click and choose Refactor | Extract Members to Partial in the context menu.

    • Choose ReSharper | Refactor | Extract Members to Partial… in the main menu.

    The Extract Members to Partial dialog will open.

  3. If the current type is not partial, ReSharper will suggest to create a new part. Otherwise, you can choose whether to create a new part or choose one of the existing parts to move the members.

  4. Select type members that should be moved to the new part of a partial type. If you invoked this refactoring on selected members or on a region with some members, these members will be preselected for you.

  5. To apply the refactoring, click Next.

  6. If no conflicts are found, ReSharper performs the refactoring immediately. Otherwise, it prompts you to resolve conflicts.

ReSharper. 'Make Partial' refactoring

This feature is supported in the following languages and technologies:

Language: C#Language: VB.NETLanguage: C++Language: HTMLLanguage: ASP.NETLanguage: RazorLanguage: JavaScriptLanguage: TypeScriptLanguage: CSSLanguage: XMLLanguage: XAMLLanguage: ResxLanguage: Build ScriptsLanguage: ProtobufLanguage: JSON
Feature is available in C#Feature is not available in Visual Basic .NETFeature is not available in C++Feature is not available in HTMLFeature is not available in ASP.NETFeature is not available in RazorFeature is not available in JavaScriptFeature is not available in TypeScriptFeature is not available in CSSFeature is not available in XMLFeature is not available in XAMLFeature is not available in Resource filesFeature is not available in build script filesFeature is not available in ProtobufFeature is not available in JSON
Last modified: 03 September 2020