/// <summary> /// Determines if the given value represents a valid state of this property. /// </summary> /// <param name="value">The state that should be used.</param> /// <returns>True if the state is valid, otherwise false.</returns> protected override Boolean IsValid(CSSValue value) { FontWeightMode weight; if (value is CSSIdentifierValue && _weights.TryGetValue(((CSSIdentifierValue)value).Value, out weight)) _weight = weight; else if (value.ToInteger().HasValue) _weight = new NumberWeightMode(value.ToInteger().Value); else if (value != CSSValue.Inherit) return false; return true; }
protected override Boolean IsValid(CSSValue value) { FontWeightMode weight; if (value is CSSIdentifierValue && _weights.TryGetValue(((CSSIdentifierValue)value).Value, out weight)) { _weight = weight; } else if (value.ToInteger().HasValue) { _weight = new NumberWeightMode(value.ToInteger().Value); } else if (value != CSSValue.Inherit) { return(false); } return(true); }
internal CSSFontWeightProperty() : base(PropertyNames.FontWeight) { _weight = _weights["normal"]; _inherited = true; }