using Newtonsoft.Json.Linq;
using Antlr4.StringTemplate;
using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
'title':'title of main slider',
'subtitle':'subtitle of main slider',
'description':'description of main slider',
'radioParam':'label_two',
'selectParam':'label_two',
'originalFileName':'main-slider-2.png',
'contentType':'image/png',
'newFileName':'images/87141be5a54a439881b0de17bb4e68ff.png',
'securePath':'AL7vgVXIq5aBzeKTlpkLR2CuVS4=/images/87141be5a54a439881b0de17bb4e68ff.png',
'secureThumbPath':'ibf75uV2cxrq88x_idxST3lDcEU=/images/87141be5a54a439881b0de17bb4e68ff-thumb.png'
'sliderItemTitle':'YENI LUKS',
'originalFileName':'Screen Shot 2019-10-19 at 21.39.51.png',
'contentType':'image/png',
'newFileName':'images/1bd49c17c16b4ea4a8fcbd52aee25e5b.png',
'securePath':'m_U5gbeIzmlCRNW1PYCuEke08gI=/images/1bd49c17c16b4ea4a8fcbd52aee25e5b.png',
'secureThumbPath':'4bxT9kZ-Rd7Y4froOy3RJR6myKI=/images/1bd49c17c16b4ea4a8fcbd52aee25e5b-thumb.png'
'sliderItemTitle':'LAGOM',
'originalFileName':'Screen Shot 2019-10-19 at 23.06.51.png',
'contentType':'image/png',
'newFileName':'images/34bbd8ebd094497099c05569d84f3c0f.png',
'securePath':'XY2Xf-_raliCCIp5SxQJw3biPXw=/images/34bbd8ebd094497099c05569d84f3c0f.png',
'secureThumbPath':'3oZBTIIAgdVQVwjQaSHWeoWy-2o=/images/34bbd8ebd094497099c05569d84f3c0f-thumb.png'
'sliderItemTitle':'GLAM',
'originalFileName':'Screen Shot 2019-10-19 at 23.09.30.png',
'contentType':'image/png',
'newFileName':'images/fb52767dac584792a87b64285a851a01.png',
'securePath':'mWZmuRzI4jxuGJFrnak-MsKkGCw=/images/fb52767dac584792a87b64285a851a01.png',
'secureThumbPath':'iGYsY4_NLwgis2qEb7S12wjGG_o=/images/fb52767dac584792a87b64285a851a01-thumb.png'
'sliderItemTitle':'BASIC',
'originalFileName':'Screen Shot 2019-10-19 at 23.09.42.png',
'contentType':'image/png',
'newFileName':'images/7023fa9ffeb2484a828993491e859483.png',
'securePath':'wzJwLZgoFX0jTRydBk1EyGhTwxA=/images/7023fa9ffeb2484a828993491e859483.png',
'secureThumbPath':'jbQpYfBt1M1cz8YY6cpqwi7533Y=/images/7023fa9ffeb2484a828993491e859483-thumb.png'
<img src='$imgName.secureThumbPath$'/>
<img src='$imgName.securePath$'/>
<div>$it.sliderItemTitle$</div>
var uri = new Uri("http://www.vivense.com/");
using (var httpClient = new HttpClient())
Task<string> t = httpClient.GetStringAsync(uri);
slot = slot.Replace("$", "\\$");
var jsonObject = JObject.Parse(json);
Template template = new Template(slot,'$', '$');
template.Group.RegisterModelAdaptor(typeof(JToken), new JTokenModelAdaptor());
var objectPropertyNames = jsonObject.Properties().Select(x => x.Name).ToArray();
foreach(var propertyName in objectPropertyNames){
var propertyValue = jsonObject.GetValue(propertyName, StringComparison.OrdinalIgnoreCase);
if(propertyValue is JValue){
template.Add(propertyName,propertyValue.ToString());
template.Add(propertyName,propertyValue);
Console.WriteLine(template.Render());
internal class JTokenModelAdaptor : Antlr4.StringTemplate.IModelAdaptor
public object GetProperty(
Antlr4.StringTemplate.Interpreter interpreter,
Antlr4.StringTemplate.TemplateFrame frame,
var token = (obj as JToken)?.SelectToken(propertyName);
var jval = token as JValue;