string Preprocess (string input) { DummyHost host = new DummyHost (); string className = "PreprocessedTemplate"; string classNamespace = "Templating"; string language = null; string[] references = null; TemplatingEngine engine = new TemplatingEngine (); string output = engine.PreprocessTemplate (input, host, className, classNamespace, out language, out references); output = output.Replace ("\r\n", "\n"); return TemplatingEngineHelper.StripHeader (output, "\n"); }
string Preprocess (string input, DummyHost host) { string className = "PreprocessedTemplate"; string classNamespace = "Templating"; string language = null; string[] references = null; TemplatingEngine engine = new TemplatingEngine (); string output = engine.PreprocessTemplate (input, host, className, classNamespace, out language, out references); ReportErrors (host.Errors); if (output != null) { return TemplatingEngineHelper.CleanCodeDom (output, "\n"); } return null; }
static string Preprocess(string input, DummyHost host) { string className = "PreprocessedTemplate"; string classNamespace = "Templating"; var engine = new TemplatingEngine(); string output = engine.PreprocessTemplate(input, host, className, classNamespace, out _, out _); ReportErrors(host.Errors); if (output != null) { return(TemplatingEngineHelper.CleanCodeDom(output, "\n")); } return(null); }
public void GenerateStaticPropertyForParameter() { var engine = new TemplatingEngine(); var host = new DummyHost(); var output = engine.PreprocessTemplate(T4ParameterSample, host, "ParameterTestClass", "Testing", out string language, out string[] references); foreach (TemplateError error in host.Errors) { Console.Error.WriteLine(error.Message); } Assert.IsTrue(output.Contains("public static string TestParameter")); Console.Out.WriteLine(output); }
string Preprocess(string input, DummyHost host) { string className = "PreprocessedTemplate"; string classNamespace = "Templating"; string language = null; string[] references = null; TemplatingEngine engine = new TemplatingEngine(); string output = engine.PreprocessTemplate(input, host, className, classNamespace, out language, out references); ReportErrors(host.Errors.ToCompilerErrorCollection()); if (output != null) { return(TemplatingEngineHelper.CleanCodeDom(output, "\n")); } return(null); }
string Preprocess(string input, DummyHost host) { string className = "PreprocessedTemplate"; string classNamespace = "Templating"; string language = null; string[] references = null; TemplatingEngine engine = new TemplatingEngine(); string output = engine.PreprocessTemplate(input, host, className, classNamespace, out language, out references); ReportErrors(host.Errors); if (output != null) { output = output.Replace("\r\n", "\n"); return(TemplatingEngineHelper.StripHeader(output, "\n")); } return(null); }
public string PreprocessTemplate(string content, ITextTemplatingEngineHost host, string className, string classNamespace, out string language, out string[] references) { return(engine.PreprocessTemplate(content, host, className, classNamespace, out language, out references)); }