Пример #1
0
        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)));
        }
Пример #2
0
 private static string GetEnumTitle(this GlyphIconType @self)
 {
     return(@self.GetAttribute <EnumTitleAttribute>() != null? @self.GetAttribute <EnumTitleAttribute>().Title : null);
 }