Reputation: 10479
When I write my APIs for applications I always follow a set pattern (who doesnt!?) that looks like this:
User (Folder/Namespace)
User.cs
UserDao.cs
UserDaoFactory.cs
UserService.cs
UserServiceFactory.cs
I know Resharper has file templates which I already utilize, but it would be great if I didn't have to individually add each file which can get extremely tedious when you are working with upwards of 30 entities in an app. If you can't do this with resharper is there anyway to make some kind of macro with Visual Studio that will execute your resharper file templates?
Upvotes: 6
Views: 2192
Reputation: 554
Looks like R# 8 added this feature
From the Resharper Help Page
Starting from ReSharper 8.0, each file template can add more than one file when it is applied. This > may be helpful for WPF, Web and other projects where related data can be saved in different files.
Here are a few things you need to know about multi-file templates:
- A file template always include one main file, and, optionally, any number of secondary files. So as soon as you add a secondary file to any file template you get a multi-file template.
- When adding a secondary file, you can reference any existing file template (Add file from existing template option). Note that if the referenced template has multiple files too, then only the main file of the referenced template will be added when you apply the template.
- The set of parameters spans all files of a multi-file template. I.e., if you use the same parameter $PARAM$ in several files of a multi-file template, it will have the same value in all related files when the template is applied.
- If a multi-file templates has editable parameters, the Hot Spot Session, which deploys when you apply this template, will guide you through all created files where the user input is required.
Upvotes: 2
Reputation: 1064
I would consider using .tt templates with ReSharper.
Upvotes: 0
Reputation: 10148
Upvotes: 6