Using file headers for copyright notices and other identifying messages is a common practice. ReSharper provides a handy way to insert a common file header into code files in your solution in batch mode.
- Choose ReSharper | Options | Code Editing | File Header Text.
- 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.
- Choose Code Editing | Code Cleanup in the ReSharper Options dialog box.
- Create a new profile as described in
Creating Custom Profiles. In the Selected profile settings for the new profile, select Update file header.
- Click OK to save the new profile and close the ReSharper Options dialog box.
- Open the Code Cleanup dialog box from the text editor or Solution Explorer as described in
Running Code Cleanup. Note that triggering Code Cleanup upon a selection prevents ReSharper from inserting the file header.
- When the Code Cleanup dialog box opens, select the newly created profile in the Available Profiles area.
- Click Run to perform Code Cleanup. ReSharper will update all affected files with the file header.