I created a simple development-time pattern that uses an enumeration that resides in the same project. The template defines the class definition for each variable in this type of enumeration.
I noticed that modifying and saving the .tt file in any case causes it to deflate the C # code again. I hope that I can establish the solution so that if I change the enumeration and then save, then the template can also start the source again. That way, when I want to add a new type, I could add a variable to the enum definition and maybe just click save.
At the moment, I have to do this:
- Add a variable to the enumeration definition in the .cs file.
- Compile the project.
- Run the "run custom tool" in the .tt file. template.
- then you need to compile the compilation again in the source created by t4.
So, maybe there is a way to make the pattern “detect” a change in another source using what it uses, and act as if it were changed by itself?
source
share