ReSharper Web Help

For inherited types, ReSharper provides two related code generation features:

  • Implement missing members implements any interface members or abstract members missing from the current class.
  • Override members does the same as Implement missing members, but it also overrides virtual members if applicable.

Tip

You can set up common code generation options in the ReSharper | Options | Code Editing | Members Generation.

To implement and/or override members
  1. Position the caret within a class where you would like to implement and/or override members.
  2. On the main menu, choose ReSharper | Edit | Generate Code, or press Alt+Insert.
  3. In the Generate pop-up menu, select Missing members or Overriding members.

    Tip

    There is an alternative way to open the Implement missing members page of the Generate wizard: position the caret over the declaration of a class where members must be implemented, press Alt+Enter or click on the quick-fix icon, and then choose Implement members in the action list:
    'Implement members' action in the action list

  4. In the Generate dialog box that appears, select members to implement and/or override:
    Generating overriding members

    Note

    The Implement missing members page differs from Override members (shown above) in two ways:

    • It does not show overridable members (such as members of the Object class in this case).
    • It does not emphasize must-implement members with bold.
  5. Optionally, use the following controls that are applied to all implemented/overridden members at this point (see next step for guidelines on configuring individual members):
    • Implement as lets you choose whether to implement members as:
      • Public members.
      • Public virtual members.
      • Explicitly implement them as private members.
    • Properties as lets you choose whether to implement properties as:

      Tip

      You can set the default way for generating properties in the ReSharper | Options | Code Editing | Members Generation.

  6. Do one of the following:
    • To configure generation options (listed in the previous step) individually for specific members, click Advanced. You can then select individual members, or Ctrl-click two or more members to configure their settings in a uniform fashion. After finishing this step, click Next, and as soon as the following screen appears, click Finish.
    • Click Finish to complete the wizard right away.

Tip

Depending on your settings, in the bodies of generated implementations ReSharper throws new NotImplementedException(), returns default value, or puts code that will not compile. For more information, see ReSharper | Options | Code Editing | Members Generation

Tip

To bind any code generation command to its own shortcut, go to Tools | Options | Environment | Keyboard and look for commands starting with ReSharper_Generate.


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

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.