private static string TextReaderRenderer(ITexplate texplate, StreamReader reader) { reader.AssertNotNull("reader"); lock (reader) { var tRes = string.Empty; reader.BaseStream.Position = 0; for (;;) { var tLine = reader.ReadLine(); if (tLine == null) { break; } tLine = Regex.Replace( tLine, @"\$\{(\w+)\}", xMatch => TexplateReplace(texplate, xMatch) ); tRes += tLine + Environment.NewLine; } return(tRes); } }
private static string TexplateReplace(ITexplate texplate, Match match) { string tRet = string.Empty; if (match.Groups.Count == 2 && texplate != null) { var tResValue = texplate[match.Groups[1].Value]; if (tResValue != null) { tRet = tResValue.Render(texplate); } } return(tRet); }
private string RenderList(ITexplate texplate, ITexplateClause clause) { string tRet = string.Empty; if (clause != null) { foreach (var iClp in this.clipList) { using (texplate.EnterContext(iClp)) { tRet += clause.Render(texplate); } } } return(tRet); }
private string RenderPgsList(ITexplate texplate, ITexplateClause clause) { string tRet = string.Empty; if (clause != null) { foreach (var iPgs in this.pgsList.Values) { using (texplate.EnterContext(iPgs)) { tRet += clause.Render(texplate); } } } return(tRet); }
private string RenderClipRefEntries(ITexplate texplate) { return(RenderList(texplate, texplate.AssertNotNull("texplate")["ClipRefEntry"])); }
public string Render(ITexplate texplate) { return(renderer(texplate)); }
private string RenderPgsProgInfoes(ITexplate texplate) { return(RenderPgsList(texplate, texplate.AssertNotNull("texplate")["PgsProgInfo"])); }
private string RenderPgsEntries(ITexplate texplate) { return(RenderPgsList(texplate, texplate.AssertNotNull("texplate")["PgsEntry"])); }