[英]How can I create an addin in Visual Studio to generate javascript, CSS and other code from a settings file
My VS 2010 ASP.Net Web App project would have: 我的VS 2010 ASP.Net Web App项目将具有:
1. Settings file (names of actions, behavior, location of an image in an image cluster, etc.) 1.设置文件(动作名称,行为,图像在图像集群中的位置等)
2. A javascript containing functions for the actions to use. 2.一个JavaScript,其中包含要使用的操作的功能。 This file that will get combined in with other javascript files at build time and is OK to overwrite each time as I won't need to customize anything here after it's generated.
该文件将在构建时与其他javascript文件合并在一起,并且每次都可以覆盖,因为生成后不需要在此处自定义任何内容。
3. A CSS file containing information such as the background attribute for a DIV that I'm using as a button to offset into a location within an image cluster. 3.一个CSS文件,其中包含诸如DIV的背景属性之类的信息,我将其用作按钮以偏移到图像群集内的某个位置。
What I want is: 我想要的是:
An addin or some command/entity that I can easily trigger via Visual Studio UI to process the settings and recreate the files containing javascript and css for the actions specified in the settings. 我可以通过Visual Studio UI轻松触发的插件或某些命令/实体,以处理设置并为设置中指定的动作重新创建包含javascript和css的文件。 The reason I want this is because I'll have 30+ actions and possibly more in the future and don't want to recreate these any time I make changes of how I want them to work and easily be able to add new ones and have the JS and CSS quickly regenerated.
我想要这个的原因是因为我将来会有30多个动作,并且可能还会更多,并且不想在我改变它们的工作方式并能够轻松添加新动作并具有JS和CSS很快重新生成。
You can use T4 templates. 您可以使用T4模板。 They can generate any text file based on the template that is written as a mixture of plain text and C#.
他们可以基于纯文本和C#混合编写的模板生成任何文本文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.