Exemple #1
0
 /// <summary>
 /// Changes the button to use the given size.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithSize(ButtonSize.Large)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="size">The size of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithSize(this ButtonHtmlAttributes attrs, ButtonSize size)
 {
     if (size != ButtonSize.Default && size != ButtonSize.NoneSpecified)
     {
         attrs.AddClass($"btn-{size.Humanize()}");
     }
     return(attrs);
 }
 /// <summary>
 /// Changes the button to use the given size.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithSize(ButtonSize.Large)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="size">The size of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithSize(this ButtonHtmlAttributes attrs, ButtonSize size)
 {
     if (size != ButtonSize.Default)
     {
         attrs.AddClass(string.Format("btn-{0}", size.Humanize()));
     }
     return(attrs);
 }
Exemple #3
0
 /// <summary>
 /// Adds the given emphasis to the button.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithStyle(EmphasisStyle.Warning)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="style">The style of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
 {
     attrs.AddClass($"btn-{style.ToString().ToLower()}");
     return(attrs);
 }
 /// <summary>
 /// Adds the given emphasis to the button.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithStyle(EmphasisStyle.Warning)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="style">The style of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
 {
     attrs.AddClass(string.Format("btn-{0}", style.ToString().ToLower()));
     return(attrs);
 }