Partial methods are defined in different parts (different files) of a partial type. One part contains the signature of the method while another part contains its implementation.
ReSharper provides the Generate partial methods feature that will create implementation stubs for not implemented partial methods.
- In the editor, position the caret within a partial type at the line where you want to insert implementations of partial methods.
- On the main menu, choose ReSharper | Edit | Generate Code, or press Alt+Insert.
- In the Generate pop-up menu, select Partial methods.
Generate dialog box that appears, select partial methods
to create implementation stubs for.
- Click Finish to complete the wizard.
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
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:
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.
- Generating Type Constructors
- Generating Properties
- Implementing/Overriding Members
- Generating Equality Members
- Generating Equality Comparer
- Generating Delegating Members
- Generating Formatting Members