Beispiel #1
0
        /// <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();
        }
Beispiel #2
0
 /// <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)));
 }
Beispiel #3
0
 /// <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));
 }
Beispiel #4
0
 /// <summary>
 /// Returns the <see cref="FAIconAttribute" /> associated with the icon, containing its metadata
 /// </summary>
 public static FAIconAttribute GetFAIconAttribute(this FAIcons icon) =>
 icon.GetAttributeOfType <FAIconAttribute>();
Beispiel #5
0
 /// <summary>
 /// Returns the style of the icon as a string, eg "brands"
 /// </summary>
 public static string Style(this FAIcons icon) => icon.FAStyle().Style();
Beispiel #6
0
 /// <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;
Beispiel #7
0
 /// <summary>
 /// Returns the unicode character of the icon, eg "f113"
 /// </summary>
 public static string Unicode(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Unicode;
Beispiel #8
0
 /// <summary>
 /// Returns the label of the icon, eg "Alternate GitHub"
 /// </summary>
 public static string Label(this FAIcons icon) => icon.GetAttributeOfType <FAIconAttribute>().Label;
Beispiel #9
0
 /// <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;
 }
Beispiel #11
0
 /// <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));
 }
Beispiel #12
0
 /// <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);
 }
Beispiel #13
0
 /// <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();
 }