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:
To implement and/or override members
- Set the caret within a class where you would like to implement and/or override members from base types.
- In the Generate dialog that appears, select members to implement and/or override:
- 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:
- Properties as lets you choose whether to implement properties as:
- Traditional properties with default accessor bodies. (See the Generated member default body style setting in the ReSharper | Options | Code Editing | Members Generation )
- Traditional properties that access private fields
- Automatic properties
- Click Finish to complete the wizard.
You can also click Options to review or modify common code generation preferences on the 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 page of ReSharper options.
This feature is supported in the following languages/technologies:
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.