/// <summary> /// Initializes a new instance of the <see cref="ItemTemplates"/> class. /// </summary> public ItemTemplates() { TypeTemplates.Add(typeof(DateTime), TemplateConfig.Instance.DateTimeTemplate); ControlTemplates.Add(Control.General, TemplateConfig.Instance.GeneralTemplate); ControlTemplates.Add(Control.CheckBox, TemplateConfig.Instance.CheckBoxTemplate); ControlTemplates.Add(Control.RadioButton, TemplateConfig.Instance.RadioButtonTemplate); DefaultHtmlAttributes = new { @class = TemplateConfig.Instance.DefaultHtmlAttributes }; }
private string TypeTemplateFor(Type type) { return(TypeTemplates.ContainsKey(type) ? TypeTemplates[type] : string.Empty); }