[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush Classic
  What's New
 [Expand]System Requirements
  [Expand]Code Analysis
  [Expand]Code Style
   Feature Advisor
   FrictionFree Mode
   Mastering CodeRush Classic Features
  [Expand]Visualization Tools
  [Expand]Advanced Selection Tools
  [Expand]Clipboard Tools
  [Collapse]Coding Assistance
   [Expand]Code Providers
   [Collapse]Code Templates
     Common Code Blocks
     Member Declaration
     One Key Templates
     Types Declaration
     XPO and XAF Templates
    Automatic Declaration
    Cycle Scope Up/Down
    Duplicate Line
    Smart Constructor
    Smart Enter
    Smart Parens and Brackets
    Smart Paste
   Unit Test Runner
 [Expand]Visual Elements
 [Expand]Tool Windows
 [Expand]CodeRush Classic Options
  Get More Help
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Code Templates

Code templates are blocks of code that expand from short abbreviations typed into the code editor. Using code templates decreases code creation time, because it helps avoid having to type the entire code manually and allows you to create regular code sections with only a few keystrokes.

CodeRush Classic includes a powerful library of simple code templates and their combinations. This library is available in C#, VB, C++, HTML, JavaScript, and XML.

To expand a template, type in the template name and press Space. For instance, to declare a method returning a string, type in "ms" and press Space.

Code templates are context-sensitive. That is, a single template expands appropriately for different contexts. For instance, the "mb" template declares a Boolean method inside a class, or generates a call to MessageBox.Show() inside a method.

You can customize existing templates and create new templates in the Templates options page. The templates are grouped into categories and subcategories that enable you to easily find desired templates or categories.

You can find the information on the most high-usage templates in the following topics.

For the information on other templates, see CodeRush Classic tool window or the Templates options page.

Is this topic helpful?​​​​​​​