The Move to Another File refactoring helps you move the chosen type from the current file to any other file. All necessary directives are moved with the type. All using directives that are no longer necessary are removed from the original file.
- Place the caret at the name of a class or interface, etc. in the editor or select it in the Class View window or in the Object Browser window.
Do one of the following:
- On the main menu, choose ReSharper | Refactor | Move.
- Choose Refactor | Move on the context menu.
- Press F6Ctrl+R,O.
In the Move drop-down list, click Move to Another File.
The Move to Another File dialog box opens:
- Type a file name in the New file name text box. You can specify the name for an existing file or a new one. In the latter case, the new file is created in the current folder.
- Click Next. If no conflicts are found, ReSharper performs the refactoring immediately. Otherwise, resolve conflicts.
TipWhen you undo this action, be aware that content is deleted from the newly created file, however the file itself is preserved in project.
This feature is supported in the following languages/technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.