Change Method Parameters Dialog Box
See Also
Use this dialog box to specify options for the Change Method Parameters refactoring command.
You can use the Change Method Parameters command to alter the signature of a
method and have those changes propagated in all of the code that calls this method.
Specifically, you can:
- Add parameters to a method.
- Reorder the parameters in a method signature.
- Change the access modifier for the method.
You can open the Change Method Parameters
dialog box from the Source Editor, Projects window, or Files window. In one
of these windows, right-click a field and choose Refactor > Change Method Parameters.
The dialog box has the following fields:
- Parameters. Table that contains a list of parameters for the
method. Use the Add, Move Up, and Move Down buttons
to add and rearrange the order of parameters.
Use the Remove button to remove any parameters that you have added
in the dialog box but that you do not want to keep.
You can not remove parameters that were in the method
before you opened the dialog box.
The Parameters table has columns for the method name,
type, and default value. Double-click in a cell to edit a value.
- Access Modifier. Drop-down list containing the four
possible accessibility modifiers (public, protected,
<default>, and private). Select the accessibility
modifier that you want the method to have.
- Method Signature Preview. Read-only field that displays
what the method signature will look like if you apply the changes
that you have specified in the dialog box.
If you want to preview the changes, you need to follow these steps
to complete the refactoring:
- Click Preview.
The Refactoring
window opens and displays a tree view of the code to be affected by the refactoring.
- Check the items displayed in the Refactoring window to make sure that you want them
all changed. Clear the checkbox next to any parts of the code that
you do not want changed.
- Click Do Refactoring.
- You should always perform a clean build after completing
any refactoring commands. You can do a clean build by right-clicking the project's
node in the Projects window and choosing Clean and Build Project.
- See Also
- About Refactoring
- Refactoring: Quick Reference
- Undoing Refactoring Changes
Legal Notices