Introduce Method Dialog Box

See Also

Use this dialog box to specify options for the Introduce Method refactoring command. You can use the Introduce Method command to create a new method from selected code in the IDE. When you use this operation, a method is created and selected code is replaced with a call to the new method.

You can open the Introduce Method dialog box by selecting the block of code that you want to have extracted into a method, pressing Alt-Enter, and then choosing Introduce Method.

The dialog box has the following fields:

If you want to preview the changes, you need to follow these steps to complete the refactoring:

  1. Click Preview.

    The Refactoring window opens and displays a tree view of the code to be affected by the refactoring.

  2. 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.
  3. Click Do Refactoring.
See Also
About Refactoring
Refactoring: Quick Reference
Undoing Refactoring Changes

Legal Notices