Interactive Templates
This section describes templates from the templates library that can be configured before expanding.
Important
Visual Studio IntelliSense has priority over CodeRush templates. For information on how to prioritize a CodeRush template over Visual Studio IntelliSense, refer to the following topic section: Expand a Template Instead of Visual Studio IntelliSense.
Clipboard-aware Templates
The Templates library contains a number of templates that acquire the clipboard text and expand with your identifier already on its place. Use the following templates within methods, preliminarily copying an identifier to the clipboard.
Template | Expansion |
---|---|
fe | Create foreach loop against a variable from clipboard |
fri | Create for loop bounded by a variable from clipboard |
st | Assign true to a variable from clipboard |
sf | Assign false to a variable from clipboard |
sn | Assign null to a variable from clipboard |
Smart Constructor
The Smart Constructor generates constructors that initialize properties contained in the current class.
The Smart Constructor template is “cc“, type it within the appropriate class and press Enter. After this, the CodeRush will suggest a list of members to be initialized in the constructor. Check the desired members and press Enter. The constructor will be generated allowing you to change its parameters.