/// <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, EBootstrapIcon?icon, object htmlAttributes = null) : base(EHtmlTag.Div, htmlAttributes) { IHtmlComponent i = (icon != null) ? BootstrapUtil.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 BootstrapIconlink(EFontAwesomeIcon icon, string url, object htmlAttributes = null) : base(string.Empty, url, htmlAttributes) { CssClasses.Add("icon-only-link"); m_icon = BootstrapUtil.CreateIcon(icon); PrependTags.Add(m_icon); }
/// <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 BootstrapIconlink(EBootstrapIcon icon, string url, object htmlAttributes = null) : base(string.Empty, url, htmlAttributes) { CssClasses.Add("icon-only-link"); IHtmlComponent iconElement = BootstrapUtil.CreateIcon(icon); PrependTags.Add(iconElement); }
/// <summary> /// Renders a Bootstrap Font-Awesome icon /// </summary> /// <param name="html">Current Html helper object</param> /// <param name="icon">Icon to be rendered</param> /// <param name="size">Icon size</param> /// <param name="htmlAttributes">Extra HTML attributes</param> /// <returns>A Bootstrap icon</returns> /// <exception cref="FontAwesomeVersionException"> /// Thrown when a valid FontAwesome /// icon library version is not selected /// </exception> public static IExtendedHtmlStringLegacy Icon(this HtmlHelper html, EFontAwesomeIcon icon, EFontAwesomeIconSize size = EFontAwesomeIconSize.Normal, object htmlAttributes = null) { return(BootstrapUtil.CreateIcon(icon, size, htmlAttributes).ToHtmlElement()); }
/// <summary> /// Renders a Bootstrap icon /// </summary> /// <param name="html">Current Html helper object</param> /// <param name="icon">Icon to be rendered</param> /// <param name="htmlAttributes">[Optional] Extra HTML attributes</param> /// <returns>A Bootstrap icon</returns> /// <exception cref="BootstrapVersionException"> /// Thrown when a valid Bootstrap version /// is not selected /// </exception> public static IExtendedHtmlStringLegacy Icon(this HtmlHelper html, EBootstrapIcon icon, object htmlAttributes = null) { return(BootstrapUtil.CreateIcon(icon, htmlAttributes).ToHtmlElement()); }