Share via


Refactoring Shortcut Keys, Visual C# Scheme

The following key combinations are shortcuts for performing Refactoring operations.

Note

When you select Visual C# Development Settings in the Import and Export Settings Wizard, the Visual C# 2005 keyboard mapping scheme is applied. Visual C# 2005 is the current keyboard mapping scheme. This is the keyboard mapping scheme that is applied to the integrated development environment (IDE) at initial startup. For more information, see How to: Change Select Settings.

To switch to the Visual C# keyboard mapping scheme

  1. On the Tools menu, click Options.

  2. Expand Environment, and then click Keyboard.

  3. Select Visual C# 2005 from the Apply the following application keyboard mapping scheme drop-down list.

Command Name

Shortcut Keys

Description

Refactor.EncapsulateField

CTRL + R, E

Displays the Encapsulate Field Dialog Box, which allows for creation of a property from an existing field and updates all references to use the new property.

Refactor.ExtractInterface

CTRL + R, I

Displays the Extract Interface Dialog Box, which allows for creation of a new interface with members derived from an existing class, struct, or interface.

Refactor.ExtractMethod

CTRL + R, M

Displays the Extract Method Dialog Box, which allows for creation of a new method from the selected code.

Refactor.PromoteLocalVariabletoParameter

CTRL + R, P

Moves a variable from a local usage to a method, indexer, or constructor parameter and updates the call sites correctly. For more information, see Promote Local Variable to Parameter.

Refactor.RemoveParameters

CTRL + R, V

Displays the Remove Parameters dialog box, which removes parameters from methods, indexers, or delegates by changing the declaration at any locations where the member is called. For more information, see Remove Parameters.

Refactor.Rename

F2

- or -

CTRL + R, R

Displays the Rename Dialog Box, which allows for renaming all references for an identifier.

Refactor.ReorderParameters

CTRL + R, O

Displays the Reorder Parameters Dialog Box, which allows for changes to the order of the parameters for methods, indexers, and delegates.

See Also

Concepts

Visual C# Default Shortcut Keys