I generate a lot of classes with T4 templates. Every time I do this I have to add the using directive by hand (via Resharper 8 which suggest the right directive.) Is it possible to do this for multiple classes with one click? Something like adjust namespaces for all the classes in project.

PS: I don't want to change the T4 template, but if Reshaper can't do this, this could be a possible solution.

Thanks in advance!

Edit: A little bit more explained: I generate classes which are derived from a handcoded baseclass. The using for the baseclass will not be set via the T4 template. So I have to set it "by hand". Or in my case I want to know if Resharper can do it on multiple classes in one action.

有帮助吗?

解决方案

You can use the 'Move to namespace...' refactoring if you want to rename a template namespace in your entire solution.

Edit Otherwise its not possible with R# to bulk insert an arbitrary using statement to multiple files. You will need to put your hands on the T4 templates in such a case.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top