public void Merge(ITemplate template, IDictionary<string, object> context, TextWriter output) { var ncontext = new global::NVelocity.VelocityContext(); foreach (var pair in context) { ncontext.Put(pair.Key, pair.Value); } velocityEngine.Evaluate(ncontext, output, "merger", template.GetContent()); }
public string Merge(ITemplate template, IDictionary<string, object> context) { var ncontext = new global::NVelocity.VelocityContext(); foreach (var pair in context) { ncontext.Put(pair.Key, pair.Value); } StringWriter sw = new StringWriter(); velocityEngine.Evaluate(ncontext, sw, "merger", template.GetContent()); return sw.GetStringBuilder().ToString(); }