The Make Method/Property Non-Static refactoring allows you to convert a static method or property into an instance method or property. All calls, implementations and overrides of the method or property are automatically updated. Reverse functionality is available with the Make Method/Property Static refactoring.
- Place the caret at the name of a static method or property in the editor.
Do one of the following:
- On the main menu, choose ReSharper | Refactor | Make Method Non-Static.
- Right-click, then click Refactor | Make Method Non-Static on the context menu.
- Press Ctrl+Shift+R, then click Make Method Non-Static.
The Make Method Non-Static dialog box opens.
Select an instance parameter from the list. If required, the instance
parameter will be substituted with this
in the method or property body.
- Select visibility for the new instance member in the Visibility section.
- Click Next. If no conflicts are found, the refactoring is performed immediately. Otherwise, resolve conflicts.