Use this dialog box to specify options for the Encapsulate Fields refactoring command. You can use the Encapsulate Fields command to create accessor methods for fields in a class. With the Encapsulate Fields command, you can also have direct references to those fields replaced with calls to the newly created accessor methods. Accessor methods are also referred to as getters and setters or read/write methods.
You can open the Encapsulate Fields dialog box from the Source Editor, Projects window, or Files window. In one of these windows, right-click a field (or a reference to the field elsewhere in your code) and choose Refactor > Encapsulate Fields.
The dialog box has the following fields:
This option only has an impact if both of the following are true:
If you want to preview the changes, you need to follow these steps to complete the refactoring:
The Refactoring window opens and displays a tree view of the code to be affected by the refactoring.