Creating Files from Templates
ReSharper enables you to create classes, interfaces, structs and other files based on file templates. Once created, a new file is added to your project and opens in the editor. The file contains source code specified in the template.
To create a new file from template
- Do one of the following:
- In the Solution Explorer, select a node where you want to create a new file from template.
- Place the caret in a code file open in the editor. In this case, the new file will be created and placed next to the current file.
- Press Ctrl+Alt+Insert or choose in the main menu.
- Choose Class, Interface, Struct, etc. or a custom item (if available) in the quick access list. If you want to use a custom file template that was not added to the quick access list, select More.
- If you have chosen More, the Choose Template dialog appears, where you can select the desired template. To optionally introduce a template into the quick access list, select its entry in the Choose Template dialog and tick the Add to quicklist check box in the lower part of the dialog before clicking OK.
- In the Create: [name of template] dialog that appears, specify the name for the new file and click OK.
- The newly created file is added to the selected place and opens in the editor (in case of multi-file template, several files will be created and opened).
This feature is supported in the following languages and technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.