public static MvcHtmlString DynamicGlyphIcon(this HtmlHelper helper, GlyphIconType glyphs, string text = null, IDictionary <string, object> htmlAttributes = null) { TagBuilder i = new TagBuilder("i"); i.MergeAttribute("class", glyphs.GetEnumTitle()); if (!string.IsNullOrEmpty(text)) { i.InnerHtml = text; } return(MvcHtmlString.Create(i.ToString(TagRenderMode.Normal))); }
private static string GetEnumTitle(this GlyphIconType @self) { return(@self.GetAttribute <EnumTitleAttribute>() != null? @self.GetAttribute <EnumTitleAttribute>().Title : null); }