ReSharper Help  

Make Method Non-Static

The Make Method Non-Static refactoring allows you to convert a static method into a an instance method. All calls, implementations and overridings of the method are automatically corrected.

The reverse functionality is also possible with the Make Method Static refactoring.

To make a method non-static

  1. Place the caret at the method name in the editor. Example:

  2. Do one of the following:
    • In the main menu, click ReSharper | Refactor | Make Method Non-Static.
    • Right-click the method name, and select Refactor | Make Method Non-Static in the shortcut menu.
    • Press Ctrl + Shift + R, and then select Make Method Non-Static.

    The Make Method Non-Static dialog opens:

  3. Select the instance parameter from the list. The instance parameter will be substituted with .this in the method body.
  4. Select visibility for the new instance method.
  5. Click Continue. If no conflicts are found, the refactoring is performed immediately. Example (continued from above):

See Also

Refactoring Code