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.
NoteFile templates use indentation defined by language-specific code style settings that you can configure in:
- ReSharper | Options | Languages | C# | Formatting Style for C#.
- ReSharper | Options | Languages | Visual Basic .NET | Formatting Style for VB.NET.
- ReSharper | Options | Languages | XML | Formatting Style for XML.
- On the main menu, choose ReSharper | Edit | New from Template.
- In the New from Template menu, choose Class, Interface, Struct, or a custom item (if available). If you want to use a custom file template that was not added to the New from Template menu, select More to display the Choose Template dialog box.
- Select a required template using the Choose Template dialog box. To optionally introduce a custom file template into the New from Template menu, select its entry in the Choose Template dialog box and select Add to quicklist in the lower part of the dialog box before clicking OK.
- When the Create: [name of template] dialog box appears, specify the name for the new file in the Enter name text field and click OK.
- Select a node in the Solution Explorer.
- Press Alt+Insert or Ctrl+Alt+Insert to display a drop-down list of available file templates:
- Select a target template. The corresponding file will be created right away.