예제 #1
0
 public static HtmlString Button(string caption, Enums.ButtonStyle style, Enums.ButtonSize size)
 {
     if (size != Enums.ButtonSize.Normal)
     {
         return(new HtmlString(
                    $"<button type=\"button\" class=\"btn btn-{style.ToString().ToLower()} btn-{ToBootstrapSize(size)}\">{caption}</button>"));
     }
     return(new HtmlString(
                $"<button type=\"button\" class=\"btn btn-{style.ToString().ToLower()}\">{caption}</button>"));
 }
예제 #2
0
 public static HtmlString Button(string caption, Enums.ButtonStyle style, Enums.ButtonSize size)
 {
     if (size != Enums.ButtonSize.Normal)
     {
         return(new HtmlString(
                    $"<button type='button' class='btn btn-{style.ToString().ToLower()} btn-{ ToBootstrapSize(size) }'>{caption}</button>"
                    ));
     }
     return(new HtmlString(
                $"<button type='button' class='btn btn-{style.ToString().ToLower()}'>{caption}" +
                $"<span class='fa fa-adn'></span></button>"
                ));
 }
예제 #3
0
        private static string ToBootstrapSize(Enums.ButtonSize size)
        {
            switch (size)
            {
            case Enums.ButtonSize.Large:
                return("btn-lg");

            case Enums.ButtonSize.Small:
                return("btn-sm");

            case Enums.ButtonSize.ExtraSmall:
                return("btn-xs");

            default:
                return("");
            }
        }
        private static string ToBootstrapSize(Enums.ButtonSize size)
        {
            string bootstrapSize = string.Empty;

            switch (size)
            {
            case Enums.ButtonSize.Large:
                bootstrapSize = "lg";
                break;

            case Enums.ButtonSize.Small:
                bootstrapSize = "sm";
                break;

            case Enums.ButtonSize.ExtraSmall:
                bootstrapSize = "xs";
                break;
            }
            return(bootstrapSize);
        }
 public static IHtmlContent BootstrapButton(this IHtmlHelper helper, string caption, Enums.ButtonStyle style, Enums.ButtonSize size)
 {
     if (size != Enums.ButtonSize.Normal)
     {
         return(new HtmlString(string.Format("<button type=\"button\" class=\"btn btn-{0} btn-{1}\">{2}</button>", style.ToString().ToLower(), ToBootstrapSize(size), caption)));
     }
     return(new HtmlString(string.Format("<button type=\"button\" class=\"btn btn-{0}\">{1}</button>", style.ToString().ToLower(), caption)));
 }
예제 #6
0
        public static MvcHtmlString SiteButton(this HtmlHelper helper, string caption, Enums.ButtonStyle style, Enums.ButtonSize size)
        {
            string format = "<button type=\"button\" class=\"btn btn-{0} {1}\">{2}</button>";

            return(new MvcHtmlString(string.Format(format, style.ToString().ToLower(), ToBootstrapSize(size), caption)));
        }