Table of Contents

Class CssPrimitiveValue

Namespace
SharpVectors.Dom.Css
Assembly
SharpVectors.Css.dll

This implements the ICssPrimitiveValue interface which represents a single CSS value.

public class CssPrimitiveValue : CssValue, ICssPrimitiveValue, ICssValue
Inheritance
CssPrimitiveValue
Implements
Derived
Inherited Members

Remarks

This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style property explicitly within the block. An instance of this interface might be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface. A CSSPrimitiveValue object only occurs in a context of a CSS property.

Conversions are allowed between absolute values (from millimeters to centimeters, from degrees to radians, and so on) but not between relative values. (For example, a pixel value cannot be converted to a centimeter value.) Percentage values can't be converted since they are relative to the parent value (or another property value). There is one exception for color percentage values: since a color percentage value is relative to the range 0-255, a color percentage value can be converted to a number; (see also the RGBColor interface).

Constructors

CssPrimitiveValue()

Only for internal use

CssPrimitiveValue(string, bool)

Fields

_colorValue
_floatValue

Properties

CssText

A string representation of the current value.

PrimitiveType

The type of the value as defined by the constants specified above.

PrimitiveTypeAsString

Methods

Create(Match, bool)
GetAbsoluteValue(string, XmlElement)
GetCounterValue()

This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a DomException is raised. Modification to the corresponding style property can be achieved using the Counter interface

GetFloatValue(CssPrimitiveType)

This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DomException is raised

GetRectValue()

This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a DomException is raised. Modification to the corresponding style property can be achieved using the Rect interface.

GetRgbColorValue()

This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a DomException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface.

GetStringValue()

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.

OnSetCssText(string)
SetFloatValue(CssPrimitiveType, double)

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.

SetFloatValue(double)
SetFloatValue(string)
SetPrimitiveType(CssPrimitiveType)
SetStringValue(CssPrimitiveType, string)

A method to set the string value with the specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a DomException will be raised.