C# Class SharpVectors.Dom.Css.CssStyleSheet

The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i.e., a style sheet whose content type is "text/css".
Inheritance: SharpVectors.Dom.Stylesheets.StyleSheet, ICssStyleSheet
Mostra file Open project: codebutler/savagesvg Class Usage Examples

Public Methods

Method Description
CssStyleSheet ( XmlNode ownerNode, string href, string title, string media, CssRule ownerRule, CssStyleSheetType origin ) : System

Constructor for CssStyleSheet

DeleteRule ( ulong index ) : void

Used to delete a rule from the style sheet.

InsertRule ( string rule, ulong index ) : ulong

Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.

Protected Methods

Method Description
GetStylesForElement ( XmlElement elt, string pseudoElt, MediaList ml, CssCollectedStyleDeclaration csd ) : void

Used to find matching style rules in the cascading order

Private Methods

Method Description
CssStyleSheet ( XmlElement styleElement, CssStyleSheetType origin ) : System

Constructor for CssStyleSheet

CssStyleSheet ( XmlProcessingInstruction pi, CssStyleSheetType origin ) : System

Constructor for CssStyleSheet

PreProcessContent ( ) : string
StringReplaceEvaluator ( Match match ) : string

Method Details

CssStyleSheet() public method

Constructor for CssStyleSheet
public CssStyleSheet ( XmlNode ownerNode, string href, string title, string media, CssRule ownerRule, CssStyleSheetType origin ) : System
ownerNode System.Xml.XmlNode The node that owns this stylesheet. E.g. used for getting the BaseUri
href string The URL of the stylesheet
title string The title of the stylesheet
media string List of medias for the stylesheet
ownerRule CssRule The rule (e.g. ImportRule) that referenced this stylesheet
origin CssStyleSheetType The type of stylesheet
return System

DeleteRule() public method

Used to delete a rule from the style sheet.
INDEX_SIZE_ERR: Raised if the specified index does not correspond to a rule in the style sheet's rule list. NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is readonly.
public DeleteRule ( ulong index ) : void
index ulong The index within the style sheet's rule list of the rule to remove.
return void

GetStylesForElement() protected method

Used to find matching style rules in the cascading order
protected GetStylesForElement ( XmlElement elt, string pseudoElt, MediaList ml, CssCollectedStyleDeclaration csd ) : void
elt System.Xml.XmlElement The element to find styles for
pseudoElt string The pseudo-element to find styles for
ml SharpVectors.Dom.Stylesheets.MediaList The medialist that the document is using
csd CssCollectedStyleDeclaration A CssStyleDeclaration that holds the collected styles
return void

InsertRule() public method

Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.
INDEX_SIZE_ERR: Raised if the specified index does not correspond to a rule in the style sheet's rule list. NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is readonly. HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index e.g. if an @import rule is inserted after a standard rule set or other at-rule. SYNTAX_ERR: Raised if the specified rule has a syntax error and is unparsable.
public InsertRule ( string rule, ulong index ) : ulong
rule string The parsable text representing the rule. For rule sets this contains both the selector and the style declaration. For at-rules, this specifies both the at-identifier and the rule content.
index ulong The index within the style sheet's rule list of the rule before which to insert the specified rule. If the specified index is equal to the length of the style sheet's rule collection, the rule will be added to the end of the style sheet.
return ulong