Generating Partial Methods
Alt+Insert |
Partial Members
ReSharper_GeneratePartialMethods
Partial methods are defined in different parts (different files) of a partial type. One part contains the signature of the method while the other part contains its implementation.
The Generate partial methods command will help you create implementation stubs for not implemented partial methods.
To generate implementations of partial methods in a partial type
- In the editor, position the caret within a partial type at the line where you want to insert implementations of partial methods.
- Press Alt+Insert or choose in the main menu .
- In the Generate pop-up menu, select Partial Members.
-
In the
Generate
dialog box that appears, select partial methods
to create implementation stubs for.
-
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
![]() |
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.