[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
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Collapse]How To
   How To Add a License to Code Files
   How To Add/Remove Line Breaks To/From Your Code
   How To Define Persistent Local Options
   How To Wrap All Long Lines in Your Code
   How to Create a Rule
   How to Add a Comment in the Start of a Section
   How to Wrap a Section into a Region
   How to Create Regions for Explicit Interface Implementations
   How to Group Interface Implementations and Wrap them into Regions
   How to Group Event Handlers and Wrap them into a Region
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How To Add a License to Code Files

CodeRush enables you to add a comment with context-dependent elements to the beginning of the file. You can use this feature to add an author and a license to all source code files in your solution:

  1. Open the CodeRush | Code Templates... window.
  2. Focus the 1-key | h template.

  3. Customize the template. You can use Text Commands and String Providers to add variable strings into it (for example, the file path). For example, add an MIT license to your code:

  4. Test the new template: open a source file and add a copyright header to it. You can execute the Add Copyright Header code provider or expand the h template on the first line:

Expanded Add a License to All Project Files

Enable the Add copyright header cleanup provider and run Code Cleanup:

  1. Open the Editor | C# | Code Cleanup options page.
  2. Check the Add copyright header item in the cleanup refactorings/providers list.
  3. Uncheck the items you do not need.
  4. Clean up your project:

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