SharpVectors.Dom.Css.CssPrimitiveValue.SetFloatValue C# (CSharp) Method

SetFloatValue() public method

A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float value. NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
public SetFloatValue ( CssPrimitiveType unitType, double floatValue ) : void
unitType CssPrimitiveType A unit code as defined above. The unit code can only be a float unit type (i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, CSS_PX, CSS_CM, CSS_MM, CSS_IN, CSS_PT, CSS_PC, CSS_DEG, CSS_RAD, CSS_GRAD, CSS_MS, CSS_S, CSS_HZ, CSS_KHZ, CSS_DIMENSION).
floatValue double The new float value.
return void
        public virtual void SetFloatValue(CssPrimitiveType unitType, double floatValue)
        {
            if(this.ReadOnly)
            {
                throw new DomException(DomExceptionType.NoModificationAllowedErr);
            }
            else
            {
                this._setType(unitType);
                _setFloatValue(floatValue);
            }
        }