public IconBoxBuilder Bordered(BootstrapColor bgColor, OvalDividerType ovalDividerType) { this.Component.Bordered = true; this.Component.BgColor = bgColor; this.Component.OvalDividerType = ovalDividerType; return(this); }
public void ChangeColor() { var colors = Enum.GetValues(typeof(BootstrapColor)).Cast <BootstrapColor>().ToList(); var random = new Random(); var c = random.Next(colors.Count); Color = colors[c]; }
public static string GetValue(BootstrapColor color) => color == BootstrapColor.Primary ? nameof(BootstrapColor.Primary).ToLower() : color == BootstrapColor.Secondary ? nameof(BootstrapColor.Secondary).ToLower() : color == BootstrapColor.Success ? nameof(BootstrapColor.Success).ToLower() : color == BootstrapColor.Danger ? nameof(BootstrapColor.Danger).ToLower() : color == BootstrapColor.Warning ? nameof(BootstrapColor.Warning).ToLower() : color == BootstrapColor.Info ? nameof(BootstrapColor.Info).ToLower() : color == BootstrapColor.Light ? nameof(BootstrapColor.Light).ToLower() : color == BootstrapColor.Dark ? nameof(BootstrapColor.Dark).ToLower() : nameof(BootstrapColor.Link).ToLower();
public ShowMessageResult Message(string title, string message, BootstrapColor type = BootstrapColor.primary) { return(new ShowMessageResult { ViewData = ViewData, TempData = TempData, Title = title, Content = message, Type = type, }); }
/// <summary> /// Set the badge icon. /// </summary> /// <param name="that">The menu builder.</param> /// <param name="id">The badge name.</param> /// <param name="color">The badge color.</param> /// <returns>The <typeparamref name="TBuilder"/> to chain the configures.</returns> public static TBuilder HasBadge <TBuilder>(this TBuilder that, string id, BootstrapColor color) where TBuilder : IMenuEntryBuilderBase { if (that.Finalized) { throw new InvalidOperationException(ModelFinalized); } if (!that.Metadata.TryGetValue("Badges", out var ee)) { ee = that.Metadata["Badges"] = new List <(string, BootstrapColor)>(); } if (!(ee is List <(string, BootstrapColor)> badges)) { throw new InvalidOperationException(EverConfigured); } badges.Add((id, color)); return(that); }
public ShareButtonsBuilder Color(BootstrapColor color) { this.Component.Color = color; return(this); }
public static string GetColorName(BootstrapColor color) { return(color.ToString().ToLower()); }
public BadgeBuilder Color(BootstrapColor color) { this.Component.BSColor = color; return(this); }
public SectionBuilder BgColor(BootstrapColor BgColor) { this.Component.BgColor = BgColor; this.Component.SectionType = Vertex.Web.Framework.UI.SectionType.Colored; return(this); }
public IconBoxBuilder ContentColor(BootstrapColor contentColor) { this.Component.ContentColor = contentColor; return(this); }
public AskPostResult AskPost(string title, string message, object?routeValues = null, BootstrapColor type = BootstrapColor.primary) { string area, controller, action; area = (string)RouteData.Values[nameof(area)]; controller = (string)RouteData.Values[nameof(controller)]; action = (string)RouteData.Values[nameof(action)]; return(AskPost(title, message, area, controller, action, routeValues, type)); }
public AskPostResult AskPost(string title, string message, string area, string controller, string action, object?routeValues = null, BootstrapColor type = BootstrapColor.primary) { if (!(routeValues is Dictionary <string, string> rvd)) { if (routeValues == null) { rvd = new Dictionary <string, string>(); } else { var vtype = routeValues.GetType(); if ((!vtype.FullName?.StartsWith("<>f__AnonymousType")) ?? true) { throw new System.ArgumentException(nameof(routeValues)); } rvd = vtype.GetProperties().ToDictionary( keySelector: p => p.Name, elementSelector: p => $"{p.GetValue(routeValues)}"); } } return(new AskPostResult { ViewData = ViewData, TempData = TempData, Title = title, Content = message, Type = type, AreaName = area, ControllerName = controller, ActionName = action, RouteValues = rvd, }); }
public AlertBuilder Color(BootstrapColor color) { this.Component.Color = color; return(this); }
public Box BgColor(BootstrapColor color) { Class(string.Format("bg-{0}", color.GetEnumDescription())); return(this); }
/// <inheritdoc cref="RegisterProviderOutput.AppendAlert(string, BootstrapColor)"/> public new RegisterProviderOutput <TModel> AppendAlert(string content, BootstrapColor color = BootstrapColor.success) { base.AppendAlert(content, color); return(this); }
public static string ToCssClass(this BootstrapColor color) { return(color.ToString().ToLower()); }
public PopupBuilder BgColor(BootstrapColor color) { this.Component.BgColor = color; return(this); }
public IconBoxBuilder Bordered(BootstrapColor bgColor) { this.Component.Bordered = true; this.Component.BgColor = bgColor; return(this); }
public static MvcHtmlString ProgressBarFor <T>(this HtmlHelper <T> helper, Expression <Func <T, double> > expression, bool showLabel, BootstrapColor color = BootstrapColor.None) { ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, helper.ViewData); return(helper.ProgressBarFor(expression, showLabel ? DefaultLabelFormatString : null, color)); }
public IconBoxBuilder TitleColor(BootstrapColor titleColor) { this.Component.TitleColor = titleColor; return(this); }
public static MvcHtmlString ProgressBar(this HtmlHelper helper, double value, string labelFormatString = null, BootstrapColor color = BootstrapColor.None) { return(helper.ProgressBar(value, new ProgressBarOptions { ShowLabel = !string.IsNullOrEmpty(labelFormatString), LabelFormatString = labelFormatString, Color = color })); }
public IconBoxBuilder IconColor(BootstrapColor iconColor) { this.Component.IconColor = iconColor; return(this); }
public static MvcHtmlString ProgressBar(this HtmlHelper helper, int value, string labelFormatString = null, BootstrapColor color = BootstrapColor.None) { return(helper.ProgressBar(value / 100.0, labelFormatString, color)); }
public ProgressBuilder Color(BootstrapColor color) { this.Component.Color = color; return(this); }
public static MvcHtmlString ProgressBar(this HtmlHelper helper, double value, bool showLabel, BootstrapColor color = BootstrapColor.None) { return(helper.ProgressBar(value, showLabel ? DefaultLabelFormatString : null, color)); }
public CountupBuilder Color(BootstrapColor color) { this.Component.AppendCssClass(string.Format("text-{0}", color.ToCssClass())); return(this); }
public static MvcHtmlString ProgressBarFor <T>(this HtmlHelper <T> helper, Expression <Func <T, double> > expression, string labelFormatString = null, BootstrapColor color = BootstrapColor.None) { ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, helper.ViewData); return(helper.ProgressBar((double)metadata.Model, labelFormatString, color)); }
public static MvcHtmlString ProgressBarFor <T>(this HtmlHelper <T> helper, Expression <Func <T, int> > expression, bool showLabel, BootstrapColor color = BootstrapColor.None) { return(helper.ProgressBarFor(expression, showLabel ? DefaultLabelFormatString : null, color)); }
public BreadcrumbBuilder TextColor(BootstrapColor textColor) { this.Component.AppendCssClass(string.Format("text-{0}", textColor.ToCssClass())); return(this); }