ReSharper Web Help

The Move to Another Type refactoring allows users to move inner classes, static fields and methods to another type. All corresponding references and usages are automatically updated, including scenarios where a member uses other members of its original type.

 Tip

To move a non-static method, perform the following sequence of refactorings: Make Method Static ->  Move to Another Type -> Make Method Non-Static .
To move a static member or an inner type
  1. Place the caret at a static member or an inner type.
  2. On the ReSharper menu or context menu, choose Refactor | Move, or press F6.
  3. If an inner type is selected, the Move drop-down list appears. Choose Move to Another Type command and the Move to Another Type dialog box opens. Otherwise, this dialog box opens immediately.

    The dialog box displays all static members of the containing class, and its inner types. You can select check boxes next to the items you want to move.

     Tip

    If the refactored static member uses another static member of the same class, ReSharper highlights the used member in blue and shows a corresponding tooltip.
  4. Type or browse to the name of the destination class. In the latter case, you can search for a type using a drop-down tree view:
  5. Select a custom access level, or leave it "as is".
  6. Click Next. If no conflicts are found, ReSharper performs the refactoring immediately. Otherwise, resolve conflicts .

See Also

Procedures