示例#1
0
        /// <summary>
        /// Returns a button with the specified text and appended icon.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
        /// <param name="text">The text value of the button.</param>
        /// <param name="icon">The icon of the button.</param>
        /// <returns>A bootstrap button.</returns>
        public static Button BootstrapButton <T>(this HtmlHelper htmlHelper, string text, IIcon <T> icon) where T : IIcon <T>
        {
            var bootstrapButton = htmlHelper.BootstrapButton(text);

            icon.AddCssClass("append");
            bootstrapButton.AddChild(icon);

            return(bootstrapButton);
        }
示例#2
0
        /// <summary>
        /// Returns a button with the specified text and prepended labeled icon.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
        /// <param name="icon">The icon of the button.</param>
        /// <param name="text">The text value of the button.</param>
        /// <returns>A bootstrap button.</returns>
        public static Button BootstrapButtonLabeled <T>(this HtmlHelper htmlHelper, IIcon <T> icon, string text) where T : IIcon <T>
        {
            var bootstrapButton = htmlHelper.BootstrapButton();

            bootstrapButton.Anchor();
            icon.AddCssClass(string.Format("{0}-label", bootstrapButton.GetBaseClass()));
            bootstrapButton.AddCssClass(string.Format("{0}-labeled", bootstrapButton.GetBaseClass()));

            bootstrapButton.AddChild(icon);
            bootstrapButton.AddChild(text);

            return(bootstrapButton);
        }