private void button2_Click(object sender, EventArgs e) { TemplateContainer container = new TemplateContainer(); container.AddAttribute("varprueba", "prueba"); container.AddAttribute("vartrans", "transformación"); container.AddAttribute("i", 7); string s = "El resultado es [%if(i > 7)%]cierto[%else%]falso"; s = TemplateTransformer.Transform(s); s = JavascriptEvaluator.ReplaceString(s, container); this.richTextBox2.Text = s; }
public TemplateContainer Convert(MetaModel metamodel) { this.model = metamodel; TemplateContainer root = new TemplateContainer(); root.AddAttribute("Test", "OK"); this.BuildDomains(root.AddChild("Domains")); this.BuildColumns(root.AddChild("Columns")); this.BuildTables(root.AddChild("Tables")); return root; }