コード例 #1
0
 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());
 }
コード例 #2
0
 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();
 }