C# 클래스 SharpVectors.Dom.Css.CssPrimitiveValue

The CSSPrimitiveValue interface represents a single CSS value.

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).

상속: CssValue, ICssPrimitiveValue
파일 보기 프로젝트 열기: codebutler/savagesvg 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
colorValue RgbColor
floatValue double

공개 메소드들

메소드 설명
GetAbsoluteValue ( string propertyName, XmlElement elm ) : CssValue
GetCounterValue ( ) : SharpVectors.Dom.Css.ICounter

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 unitType ) : double

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 ( ) : SharpVectors.Dom.Css.IRect

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 ( ) : SharpVectors.Dom.Css.IRgbColor

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 ( ) : string

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.

SetFloatValue ( CssPrimitiveType unitType, double floatValue ) : void

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.

SetStringValue ( CssPrimitiveType stringType, string stringValue ) : void

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.

보호된 메소드들

메소드 설명
CssPrimitiveValue ( ) : System

Only for internal use

CssPrimitiveValue ( string cssText, bool readOnly ) : System
_setCssText ( string cssText ) : void
_setFloatValue ( double floatValue ) : void
_setFloatValue ( string floatValue ) : void
_setType ( CssPrimitiveType type ) : void

비공개 메소드들

메소드 설명
Create ( Match match, bool readOnly ) : CssPrimitiveValue
CssPrimitiveValue ( Match match, bool readOnly ) : System

Constructor called by CssValue.GetCssValue()

메소드 상세

CssPrimitiveValue() 보호된 메소드

Only for internal use
protected CssPrimitiveValue ( ) : System
리턴 System

CssPrimitiveValue() 보호된 메소드

protected CssPrimitiveValue ( string cssText, bool readOnly ) : System
cssText string
readOnly bool
리턴 System

GetAbsoluteValue() 공개 메소드

public GetAbsoluteValue ( string propertyName, XmlElement elm ) : CssValue
propertyName string
elm System.Xml.XmlElement
리턴 CssValue

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
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Counter value (e.g. this is not CSS_COUNTER).
public GetCounterValue ( ) : SharpVectors.Dom.Css.ICounter
리턴 SharpVectors.Dom.Css.ICounter

GetFloatValue() 공개 메소드

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
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float value.
public GetFloatValue ( CssPrimitiveType unitType ) : double
unitType CssPrimitiveType A unit code to get the float value. 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).
리턴 double

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.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a rect value.
public GetRectValue ( ) : SharpVectors.Dom.Css.IRect
리턴 SharpVectors.Dom.Css.IRect

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.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a rgb value.
public GetRgbColorValue ( ) : SharpVectors.Dom.Css.IRgbColor
리턴 SharpVectors.Dom.Css.IRgbColor

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.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value.
public GetStringValue ( ) : string
리턴 string

SetFloatValue() 공개 메소드

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.
리턴 void

SetStringValue() 공개 메소드

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.
INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value. NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
public SetStringValue ( CssPrimitiveType stringType, string stringValue ) : void
stringType CssPrimitiveType A string code as defined above. The string code can only be a string unit type (i.e. CSS_STRING, CSS_URI, CSS_IDENT, and CSS_ATTR).
stringValue string The new string value
리턴 void

_setCssText() 보호된 메소드

protected _setCssText ( string cssText ) : void
cssText string
리턴 void

_setFloatValue() 보호된 메소드

protected _setFloatValue ( double floatValue ) : void
floatValue double
리턴 void

_setFloatValue() 보호된 메소드

protected _setFloatValue ( string floatValue ) : void
floatValue string
리턴 void

_setType() 보호된 메소드

protected _setType ( CssPrimitiveType type ) : void
type CssPrimitiveType
리턴 void

프로퍼티 상세

colorValue 보호되어 있는 프로퍼티

protected RgbColor colorValue
리턴 RgbColor

floatValue 보호되어 있는 프로퍼티

protected double floatValue
리턴 double