/// <summary> /// String value of the FontUnit. /// </summary> /// <param name="formatProvider">The format provider.</param> /// <returns>Returns the string version of FontUnit.</returns> public string ToString(IFormatProvider formatProvider) { string s = String.Empty; if (IsEmpty) { return(s); } switch (_type) { case FontSize.AsUnit: s = _value.ToString(formatProvider); break; case FontSize.XXSmall: s = "XX-Small"; break; case FontSize.XSmall: s = "X-Small"; break; case FontSize.XLarge: s = "X-Large"; break; case FontSize.XXLarge: s = "XX-Large"; break; default: s = _type.ToString(); break; } return(s); }
/// <summary> /// Sets the style attribute. /// </summary> /// <param name="name">Attribute name.</param> /// <param name="unit">The value to set the property to.</param> public void SetStyleAttribute(CssAttribute name, Unit unit) { SetStyleAttribute(name, unit.ToString()); }
/// <summary> /// Sets the style attribute. /// </summary> /// <param name="name">Attribute name.</param> /// <param name="unit">The value to set the property to.</param> public void SetStyleAttribute(CssAttribute name, Unit unit) { SetStyleAttribute(name, unit.ToString()); }