views:

74

answers:

2

what im looking its a template engine like freemarker (with select case directive) for writing a generator in c#.

+1  A: 

I'm not familiar with freemarker, but I believe NVelocity may do what you're looking for.

Dathan
thanks Dathan, ive seen nvelocity, but it seems it has no select directive (although there is a implementacion in castle nvelocity port), i need the select directive to do this:select case field.typecase int:bla , bla
In most cases, `switch` or `select case` structures are just a shorthand way of representing an if/then/else control structure. (Exceptions are languages where `case` blocks are expressions, and if/then/else are statements). NVelocity does not have a `case` structure, but does have an [if/then/else control structure](http://velocity.apache.org/engine/devel/user-guide.html#Conditionals).
Dathan
youre right dathan, but i think its a more elegant way to do, its like using spaguetti programming or not...i was wrong with castle nvelocity, they dont use select case either, http://www.castleproject.org/others/nvelocity/improvements.html
If it doesn't do what you want, you shouldn't accept my answer unless it turns out there isn't a better option for what you want to do. That having been said, if you're willing to consider commercial offerings, there's [CodeSmith](http://www.codesmithtools.com/).
Dathan
+1  A: 

NVelocity is a template engine I've used to generate emails. Here's how your code might look.

Darin Dimitrov