private VelocityContext CreateContext(IDictionary context) { var velocityContext = new VelocityContext(new Hashtable(context)); velocityContext.AttachEventCartridge(EscapeUtils.EscapableEventCartridge); return(velocityContext); }
protected override void BeforeFormat(INoticeMessage message, ITagValue[] tagsValues) { _nvelocityContext = new VelocityContext(); _nvelocityContext.AttachEventCartridge(new EventCartridge()); _nvelocityContext.EventCartridge.ReferenceInsertion += EventCartridgeReferenceInsertion; foreach (var tagValue in tagsValues) { _nvelocityContext.Put(tagValue.Tag, tagValue.Value); } base.BeforeFormat(message, tagsValues); }
public void Setup() { velocityEngine = new VelocityEngine(); velocityEngine.Init(); // creates the context... velocityContext = new VelocityContext(); // attach a new event cartridge velocityContext.AttachEventCartridge(new EventCartridge()); // add our custom handler to the ReferenceInsertion event velocityContext.EventCartridge.ReferenceInsertion += EventCartridge_ReferenceInsertion; }
public CustomRenderingTestCase() { velocityEngine = new VelocityEngine(); velocityEngine.Init(); // creates the context... velocityContext = new VelocityContext(); // attach a new event cartridge velocityContext.AttachEventCartridge(new EventCartridge()); // add our custom handler to the ReferenceInsertion event velocityContext.EventCartridge.ReferenceInsertion += EventCartridge_ReferenceInsertion; }
public void Setup() { ve = new VelocityEngine(); ve.Init(); // creates the context... c = new VelocityContext(); // attach a new event cartridge c.AttachEventCartridge(new EventCartridge()); // add our custom handler to the ReferenceInsertion event // c.EventCartridge.ReferenceInsertion += // new ReferenceInsertionEventHandler(EventCartridge_ReferenceInsertion); }
public void Setup() { ve = new VelocityEngine(); ve.Init(); // creates the context... c = new VelocityContext(); // attach a new event cartridge c.AttachEventCartridge(new EventCartridge()); // add our custom handler to the ReferenceInsertion event c.EventCartridge.ReferenceInsertion += new ReferenceInsertionEventHandler(EventCartridge_ReferenceInsertion); }