Class KnownIconInfo
- Namespace
- Dynamicweb.Core.UI.Icons
- Assembly
- Dynamicweb.Core.UI.dll
Maps a Known Icon to it css class
public class KnownIconInfo
- Inheritance
-
KnownIconInfo
- Inherited Members
Properties
ClassName
The css class name
public string ClassName { get; set; }
Property Value
Color
The known color for the icon
public KnownColor Color { get; set; }
Property Value
FrameworkPrefix
The css prifix required for the related framework (Ex. FontAwesome = fa)
public string FrameworkPrefix { get; set; }
Property Value
Methods
ClassNameFor(KnownIcon, bool, KnownColor)
Return the related css class name for the Enum
public static string ClassNameFor(KnownIcon icon, bool includePrefix = true, KnownColor color = KnownColor.None)
Parameters
icon
KnownIcon- The icon to get the css class name for.
includePrefix
bool- Set to false to not include prefix.
color
KnownColor- Define color to override the default icon color.
Returns
- string
- System.String.
GetCountryFlagKnownIcon(string)
Return the country flag KnownIcon for the specified two digit country code
public static KnownIcon GetCountryFlagKnownIcon(string countryCode)
Parameters
countryCode
string- Two digit country code(ISO 3166-2)
Returns
- KnownIcon
- Dynamicweb.Core.UI.KnownIcon.
Exceptions
- ArgumentException
- Thrown if imposible parse known icon from
countryCode
GetIconHtml(KnownIcon, bool, KnownColor)
Return the related html for rendering the icon.
public static string GetIconHtml(KnownIcon icon, bool includePrefix = true, KnownColor color = KnownColor.None)
Parameters
icon
KnownIcon- The icon to render.
includePrefix
bool- Set to false to not include prefix.
color
KnownColor- Define color to override the default icon color.
Returns
- string
- Html string (System.String).
GetIconHtml(KnownIcon, string, bool, KnownColor)
Return the related html for rendering the icon.
public static string GetIconHtml(KnownIcon icon, string title, bool includePrefix = true, KnownColor color = KnownColor.None)
Parameters
icon
KnownIcon- The icon to render.
title
string- Define icon title.
includePrefix
bool- Set to false to not include prefix.
color
KnownColor- Define color to override the default icon color.
Returns
- string
- Html string (System.String).
GetKnownIcon(string, KnownIcon?)
Return the KnownIcon for the specified classname
public static KnownIcon? GetKnownIcon(string iconName, KnownIcon? defaultIcon = 0)
Parameters
iconName
string- Name of the icon from the KnownIcon enumeration.
defaultIcon
KnownIcon?- Returns this value if
iconName
is not a KnownIcon
Returns
- KnownIcon?
- Dynamicweb.Core.UI.KnownIcon.