Using file headers for copyright notices and other identifying messages is a common practice. ReSharper provides a handy way to automatically insert a common file header into code files of your solution.
- Choose ReSharper | Options in the main menu.
- Open Code Editing | File Header Text page of ReSharper options.
- In the File Header Text area, insert an arbitrary text that you want to insert into your code files. You can also use macros that allow file headers to contain varying information. To use a macro, type it or click on the corresponding macro, it will be inserted at the current caret position.
- Optionally, to surround the file header with a region, enter the name of the region in the Embrace File Header into Region with Name field.
- Open Code Editing | Code Cleanup options page.
- Create a new profile as described in Creating Custom Profiles. In the Selected profile settings for the new profile, choose Update file header.
- Click Save to apply the modifications and let ReSharper choose the settings layer, or choose a particular settings layer in the Save To drop-down list. To learn more about saving ReSharper settings, see JetBrains .NET Tools Blog: Save or Save To in ReSharper Options.
- Choose ReSharper | Tools | Cleanup Code in the menu to open the Code Cleanup dialog box for the current file or for a solution node (see Running Code Cleanup for details), and then select the newly created profile in the Available Profiles area.
- Click Run to perform Code Cleanup. ReSharper will update all affected files with the new file header.