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

GetStringValue() public method

This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised. Note: Some properties (like 'font-family' or 'voice-family') convert a whitespace separated list of idents to a string.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value.
public GetStringValue ( ) : string
return string
        public virtual string GetStringValue()
        {
            string ret = null;
            switch(PrimitiveType)
            {
                case CssPrimitiveType.String:
                case CssPrimitiveType.Uri:
                case CssPrimitiveType.Ident:
                case CssPrimitiveType.Attr:
                    ret = stringValue;
                    break;
            }
            if(ret != null) return ret;
            else throw new DomException(DomExceptionType.InvalidAccessErr);
        }

Usage Example

        public override string GetStringValue()
        {
            switch (PrimitiveType)
            {
            case CssPrimitiveType.Attr:
                return(_element.GetAttribute(_cssValue.GetStringValue(), string.Empty));

            default:
                return(_cssValue.GetStringValue());
            }
        }
All Usage Examples Of SharpVectors.Dom.Css.CssPrimitiveValue::GetStringValue