Back to Devexpress

Interactive Templates

coderushforroslyn-115941-coding-assistance-code-templates-interactive-templates.md

latest1.9 KB
Original Source

Interactive Templates

  • Jan 31, 2023

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.

TemplateExpansion
feCreate foreach loop against a variable from clipboard
friCreate for loop bounded by a variable from clipboard
stAssign true to a variable from clipboard
sfAssign false to a variable from clipboard
snAssign 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.

See Also

Custom Template Creation