NET Refactor - Promote Local VariablesOptionally Create PropertiesMany times you need to move Local variables to the Class level. Additionally, you may want to create properties from the promoted variables. NET Refactor's Promote Local Variables feature can promote the selected local variables and optionally create properties in one operation.
To use Promote Local Variables, you will find the menu under the Renam Option on the NET Refactor main menu. Before clicking the menu, select the variable(s) that you wish to promote. Once you choose the menu option, the variables will be displayed in the Promote Local Variables Dialog as shown in Figure 1.
Figure 1 - Promote Local Variables.

On the dialog, there is a Create Properties checkbox. If you check this checkbox, the dialog will change its appearance as shown in Figure 2.
Figure 2 - Create Properties from Local Variables.

When you click the save button, the variables will be moved from their original location in a method to the top of the class. If you have checked Create Properties, the properties will be automatically generated and placed immediately following their respective variables. |