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.
File templates use indentation defined by language-specific code style settings that you can configure in:
- ReSharper | Options | Code Editing | C# | Formatting Style for C#.
- ReSharper | Options | Code Editing | Visual Basic .NET | Formatting Style for VB.NET.
- ReSharper | Options | Code Editing | CSS | Formatting Style for CSS.
- ReSharper | Options | Code Editing | 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, etc. 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 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.