C# Класс SharpVectors.Dom.Css.CssStyleDeclaration

The CSSStyleDeclaration interface represents a single CSS declaration block. This interface may be used to determine the style properties currently set in a block or to set style properties explicitly within the block. While an implementation may not recognize all CSS properties within a CSS declaration block, it is expected to provide access to all specified properties in the style sheet through the CSSStyleDeclaration interface. Furthermore, implementations that support a specific level of CSS should correctly handle CSS shorthand properties for that level. For a further discussion of shorthand properties, see the CSS2Properties interface. This interface is also used to provide a read-only access to the computed values of an element. See also the ViewCSS interface. Note: The CSS Object Model doesn't provide an access to the specified or actual values of the CSS cascade
Наследование: ICssStyleDeclaration
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CssStyleDeclaration ( string &css, CssRule parentRule, bool readOnly, CssStyleSheetType origin ) : System

The constructor for CssStyleDeclaration

GetPropertyCssValue ( string propertyName ) : ICssValue

Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.

GetPropertyPriority ( string propertyName ) : string

Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.

GetPropertyValue ( string propertyName ) : string

Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.

RemoveProperty ( string propertyName ) : string

Used to remove a CSS property if it has been explicitly set within this declaration block.

SetProperty ( string propertyName, string value, string priority ) : void

Used to set a property value and priority within this declaration block

this ( ulong index ) : string

Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block. The name of the property at this ordinal position. The empty string if no property exists at this position.

Приватные методы

Метод Описание
CssStyleDeclaration ( ) : System

The constructor used internally when collecting styles for a specified element

GetStylesForElement ( CssCollectedStyleDeclaration csd, int specificity ) : void

Used to find matching style rules in the cascading order

parseString ( string cssText ) : string

Описание методов

CssStyleDeclaration() публичный Метод

The constructor for CssStyleDeclaration
public CssStyleDeclaration ( string &css, CssRule parentRule, bool readOnly, CssStyleSheetType origin ) : System
css string The string to parse for CSS
parentRule CssRule The parent rule or parent stylesheet
readOnly bool True if this instance is readonly
origin CssStyleSheetType The type of CssStyleSheet
Результат System

GetPropertyCssValue() публичный Метод

Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.
public GetPropertyCssValue ( string propertyName ) : ICssValue
propertyName string The name of the CSS property. See the CSS property index.
Результат ICssValue

GetPropertyPriority() публичный Метод

Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.
public GetPropertyPriority ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
Результат string

GetPropertyValue() публичный Метод

Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.
public GetPropertyValue ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
Результат string

RemoveProperty() публичный Метод

Used to remove a CSS property if it has been explicitly set within this declaration block.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.
public RemoveProperty ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
Результат string

SetProperty() публичный Метод

Used to set a property value and priority within this declaration block
SYNTAX_ERR: Raised if the specified value has a syntax error and is unparsable. NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.
public SetProperty ( string propertyName, string value, string priority ) : void
propertyName string The name of the CSS property. See the CSS property index.
value string The new value of the property.
priority string The new priority of the property (e.g. "important").
Результат void

this() публичный Метод

Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block. The name of the property at this ordinal position. The empty string if no property exists at this position.
public this ( ulong index ) : string
index ulong
Результат string