/// <summary> /// Initializes a new instance of the <see cref="IconBuilder{TModel}" /> class. /// </summary> /// <param name="helper">The helper.</param> /// <param name="faIcon">The fa icon.</param> public BaseIconBuilder(HtmlHelper <TModel> helper, FAIcons faIcon) : base(helper) { this.faIcon = faIcon; FixedWidth(); }
/// <summary> /// Adds a Field Icon to the Field /// </summary> /// <param name="faIcon">The fa icon.</param> /// <returns></returns> public FieldBuilder <TModel, TProperty> WithFieldIcon(FAIcons faIcon) { return(WithFieldIcon(i => i.Icon(faIcon))); }
/// <summary> /// Html Helper for Creating Icons /// </summary> /// <typeparam name="TModel">The type of the model.</typeparam> /// <param name="helper">The helper.</param> /// <param name="icon">The icon.</param> /// <returns></returns> public static IconBuilder <TModel> Icon <TModel>(this HtmlHelper <TModel> helper, FAIcons icon) { return(new IconBuilder <TModel>(helper, icon)); }
/// <summary> /// Returns the <see cref="FAIconAttribute" /> associated with the icon, containing its metadata /// </summary> public static FAIconAttribute GetFAIconAttribute(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>();
/// <summary> /// Returns the style of the icon as a string, eg "brands" /// </summary> public static string Style(this FAIcons icon) => icon.FAStyle().Style();
/// <summary> /// Returns the style enum of the icon, eg <see cref="FAStyle.Brands" /> /// </summary> public static FAStyle FAStyle(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Style;
/// <summary> /// Returns the unicode character of the icon, eg "f113" /// </summary> public static string Unicode(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Unicode;
/// <summary> /// Returns the label of the icon, eg "Alternate GitHub" /// </summary> public static string Label(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Label;
/// <summary> /// Returns the key of the icon, eg "github-alt" /// </summary> public static string Key(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Key;
public void Change() { Icon = FAIcons.adjust_solid; }
/// <summary> /// Creates the Field Icon /// </summary> /// <param name="faIcon">The fa icon.</param> /// <returns></returns> public FieldIconBuilder <TModel> Icon(FAIcons faIcon) { return(new FieldIconBuilder <TModel>(helper, faIcon)); }
/// <summary> /// Initializes a new instance of the <see cref="FieldIconBuilder{TModel}"/> class. /// </summary> /// <param name="helper">The helper.</param> /// <param name="faIcon">The fa icon.</param> public FieldIconBuilder(HtmlHelper <TModel> helper, FAIcons faIcon) : base(helper, faIcon) { addOnWrapperBuilder = new AddOnWrapperBuilder <TModel>(helper, AddOnTypes.Default); }
/// <summary> /// Initializes a new instance of the <see cref="IconBuilder{TModel}" /> class. /// </summary> /// <param name="helper">The helper.</param> /// <param name="faIcon">The fa icon.</param> public IconBuilder(HtmlHelper <TModel> helper, FAIcons faIcon) : base(helper, faIcon) { //Fixed Width by Default this.FixedWidth(); }