/// <summary> /// Constructor /// </summary> /// <param name="type">Type of alert</param> /// <param name="message">Alert message</param> /// <param name="title">Title/Heading of the alert</param> /// <param name="icon">Icon to be rendered with title/heading</param> /// <param name="htmlAttributes"> /// [Optional] Any extras HTML attributes to be applied. /// Note. These attributes are only applied to the top level div /// </param> public Alert(EMessage type, string message, string title, EGumbyIcon?icon, object htmlAttributes = null) : base(EHtmlTag.Div, htmlAttributes) { IHtmlComponent i = (icon != null) ? GumbyUtil.CreateIcon(icon.Value) : null; CreateAlert(type, message, title, i); }
/// <summary> /// Constructor /// </summary> /// <param name="icon">Icon to be displayed as the hypelink</param> /// <param name="url">Link URL</param> /// <param name="htmlAttributes">[Optional Extra HTML attributes</param> public GumbyIconLink(EGumbyIcon icon, string url, object htmlAttributes = null) : base(string.Empty, url, htmlAttributes) { CssClasses.Add("icon-only-link"); IHtmlComponent iconElement = GumbyUtil.CreateIcon(icon); PrependTags.Add(iconElement); }
/// <summary> /// Renders a Gumby icon /// </summary> /// <param name="html">Current Html helper object</param> /// <param name="icon">Gumby icon</param> /// <param name="htmlAttributes">[Optional] Extra HTML attributes</param> /// <returns>A Gumby icon</returns> public static IExtendedHtmlStringLegacy Icon(this HtmlHelper html, EGumbyIcon icon, object htmlAttributes = null) { return(GumbyUtil.CreateIcon(icon, htmlAttributes).ToHtmlElement()); }