Ejemplo n.º 1
0
        public void TestMethod1()
        {
            var templateString = @"
<#@ template debug=""false"" hostspecific=""false"" language=""C#"" #>
<#@ parameter name=""Column"" type=""Kooboo.CMS.Content.Models.Column"" #>
<input name=""{0}"" type=""{1}"" value=""<%= Model["" <#= Column.Name #>""] %>"" />";

            Engine engine = new Engine();

            var host = new CustomCmdLineHost();

            host.Session           = new TextTemplatingSession();
            host.Session["Column"] = new Column()
            {
                Name = "Column1"
            };
            string output = engine.ProcessTemplate(templateString, host);

            foreach (CompilerError item in host.Errors)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine(output);
        }
Ejemplo n.º 2
0
        public void TestMethod1()
        {
            var templateString = @"
            <#@ template debug=""false"" hostspecific=""false"" language=""C#"" #>
            <#@ parameter name=""Column"" type=""Kooboo.CMS.Content.Models.Column"" #>
            <input name=""{0}"" type=""{1}"" value=""<%= Model["" <#= Column.Name #>""] %>"" />";

            Engine engine = new Engine();

            var host = new CustomCmdLineHost();
            host.Session = new TextTemplatingSession();
            host.Session["Column"] = new Column() { Name = "Column1" };
            string output = engine.ProcessTemplate(templateString, host);

            foreach (CompilerError item in host.Errors)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine(output);
        }