Skip to content
Alexandru Ciobanu edited this page Jun 2, 2015 · 6 revisions

Welcome to the XtraLiteTemplates wiki!


XtraLiteTemplates is avaliable as a NuGet package, and should work in both Microsoft Visual Studio 2013 and Xamarin Studio (MonoDevelop).

Then, there is also the options of building the source code yourself!

Use it!

After the library has been installed and references added, the easiest way to begin is simply by using the handy XLTemplate class:

var template = @"{for 1..5}{_0}!{end}";
var result = XLTemplate.Evaluate(CodeMonkeyDialect.DefaultIgnoreCase, 
    template, "Hello World");

/* Will result in:
 * "Hello World!Hello World!Hello World!Hello World!Hello World!" 

or you can create an instance of XLTemplate and evaluate it any any given moment at a later time:

/* Compile */
var template = @"{for number in list}{number * 2}{with}, {end}";
var compiledTemplate = new XLTemplate(
    CodeMonkeyDialect.DefaultIgnoreCase, template);

/* Evaluate */
var variables = new Dictionary<String, Object> 
    { { "list", new Int32[] { 1, 2, 3 } } };

var result = compiledTemplate.Evaluate(variables);

/* Will result in "2, 4, 6" */
See also:
You can’t perform that action at this time.