/// <summary> /// Returns a CSS code representation of the medium. /// </summary> /// <returns>A string that contains the code.</returns> public String ToCss() { if (_value == null) { return(String.Concat("(", _name, ")")); } return(String.Concat("(", _name, ": ", _value.ToCss(), ")")); }
/// <summary> /// Adds the new value to the current value (or replaces it). /// </summary> /// <param name="value">The value to add.</param> /// <returns>The status.</returns> Boolean AddValue(CSSValue value) { if (fraction) { if (this.value != null) { value = new CSSPrimitiveValue(CssUnit.Unknown, this.value.ToCss() + "/" + value.ToCss()); this.value = null; } fraction = false; } if (function.Count > 0) { function.Peek().Arguments.Add(value); } else if (this.value == null) { this.value = value; } else { return(false); } return(true); }