ReSharper 8.0 Web Help

The Copy Type refactoring allows you to copy a class, interface, struct, or enum from one namespace to another, or clone it within the same namespace.

To copy a type
  1. Place the caret at the name of a class, interface, struct, or enum in the editor or select it in the File Structure window, in Class View or in Object Browser.
  2. Do one of the following:
    • On the main menu, choose ReSharper | Refactor | Copy Type.
    • Right-click the type, then click Refactor | Copy Type on the context menu.
    • Press Ctrl+Shift+RCtrl+Shift+R, then click Copy Type.
  3. The Copy Type dialog box opens. Type a new name in the Name text box or leave the existing one.

    Refactorings__Copy_Type__dialog_box

  4. Specify a namespace where the copy of the type is to be created in the Namespace text box.
  5. Click Next. If no conflicts are found, ReSharper performs the refactoring immediately. Otherwise, resolve conflicts.

This feature is supported in the following languages/technologies:

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

Tip

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.