public void AddTemplate(string name, string template) { try { name = name.ToLower(); lock (mTemplates) { ITemplateInfo info = null; mTemplates.TryGetValue(name, out info); if (info == null) { info = new StringTemplateInfo(name, template); mTemplates[name] = info; } ((Implement.StringTemplateInfo)info).TemplateData = template; info.Host = this; info.Clean(); } } catch (RazorException re) { throw re; } catch (Exception e_) { throw new RazorException("add string template error " + e_.Message, e_); } }