ReSharper 2016.1 Help

Implementing/Overriding Members

ReSharper | Edit | Generate Code | Missing Members / Overriding Members
Alt+Insert | Missing Members / Overriding Members
ReSharper_GenerateImplementations / ReSharper_GenerateOverrides

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.

Normally, you would not need the Implement missing members command because ReSharper highlights types with non-implemented base members as error and lets you generate the missing members with a quick-fix:

'Implement members' quick-fix

To implement and/or override members

  1. Set the caret within a class where you would like to implement and/or override members.
  2. Press Alt+Insert or choose ReSharper | Edit | Generate Codeā€¦ in the main menu .
  3. In the Generate pop-up menu, select Missing Members / Overriding Members.
  4. In the Generate dialog box that appears, select members to implement and/or override:
    Generating overriding members
  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:
  6. Click Finish to complete the wizard.
    You can also click Options to review or modify commmon code generation preferences on the Code Editing | Members Generation page of ReSharper options

Depending on your settings, in the bodies of generated implementations ReSharper throws new NotImplementedException(), returns default value, or puts code that will not compile. You can configure your preferences on the Code Editing | Members Generation options page.

This feature is supported in the following languages/technologies:

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts Protobuf JSON
feature_available feature_available 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

Last modified: 19 August 2016