ReSharper Help

Move Type to Outer Scope

ReSharper | Refactor | Move…
F6
ReSharper_Move

This refactoring helps you move a nested type one level up. All corresponding references are automatically updated, even if the nested type uses members of the parent type.

To move a type to outer scope

  1. Select a nested type in one of the following ways:
    • In the editor, set the caret at the name of a nested type.
    • Select a nested type in the Solution Explorer.
    • Select a nested type in the File Structure window.
    • Select a nested type in the Class View.
    • Select a nested type in the Object Browser.
    • Select a nested type in the type dependency diagram.
  2. Do one of the following:
    • Press F6 and then choose Move to Outer Scope
    • Press Ctrl+Shift+R and then choose Move to Outer Scope
    • Right-click and choose Refactor | Move to Outer Scope on the context menu.
    • Choose ReSharper | Refactor | Move… in the main menu.
    The Move to Outer Scope dialog will open.
  3. Optionally, you can specify a different name for the type.
  4. Select the Search in comments check box to update references to the type in comments.
  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.
Refactorings__Move__Type_to_Outer_Scope__outer_type_name

This feature is supported in the following languages/technologies:

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

See Also

Procedures:

Last modified: 27 August 2015