wpf - Custom Code Generation in C# -


how can generate c# code xml file @ compile time? there way this? below example of xml:

<resources xmlns="" version="1.0">     <language culture="neutral">         <group name="default">             <resource name="file"><![cdata[file]]></resource>         </group>         <group name="files">             <resource name="title"><![cdata[[~default.file] selector]]></resource>             <resource name="searchlabel"><![cdata[enter search]]></resource>         </group>     </language> </resources> 

this string resource collection. can see, self referencing, resx not.

look t4 templates. t4 templates feature of visual studio allow transform arbitrary files code during build.

http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx

http://www.hanselman.com/blog/t4texttemplatetransformationtoolkitcodegenerationbestkeptvisualstudiosecret.aspx


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -