Refactoring - Introducing Fields
Go Up to Refactoring Procedures Index
This topic explains how to use the "Introduce field" operation.
To introduce a field:
- Select expression in the Code Editor.
- On the main menu, choose Refactor > Introduce Field.
Tip: Alternatively, you can choose Refactor > Introduce Field on the context menu.
- In the resulting dialog, specify the following:
- Name: Enter the name of the new field.
- Visibility: Using the list box, choose the visibility for the new field from public, protected, private, internal, or internal protected.
- Initialize: Choose where to initialize the new field. Using the list box, choose from Current method, Class constructor(s), or Field declaration.
- If applicable, check the Static and Replace all occurrences fields.
- Click OK to complete the refactoring.