skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class CssData

Holds parsed stylesheet css blocks arranged by media and classes.
CssBlock

Inheritance
System.Object
CssData
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TheArtOfDev.HtmlRenderer.Core
Assembly: Telerik.WinControls.RadMap.dll

Syntax

public sealed class CssData
Remarks

To learn more about CSS blocks visit CSS spec: http://www.w3.org/TR/CSS21/syndata.html#block

Methods

AddCssBlock(String, CssBlock)

Add the given css block to the css data, merging to existing block if required.

Declaration
public void AddCssBlock(string media, CssBlock cssBlock)
Parameters
System.String media

the media type to add the CSS to

CssBlock cssBlock

the css block to add

Remarks

If there is no css blocks for the same class it will be added to data collection.
If there is already css blocks for the same class it will check for each existing block if the hierarchical selectors match (or not exists). if do the two css blocks will be merged into one where the new block properties overwrite existing if needed. if the new block doesn't mach any existing it will be added either to the beginning of the list if it has no hierarchical selectors or at the end.
Css block without hierarchical selectors must be added to the beginning of the list so more specific block can overwrite it when the style is applied.

Clone()

Create deep copy of the css data with cloned css blocks.

Declaration
public CssData Clone()
Returns
CssData

cloned object

Combine(CssData)

Combine this CSS data blocks with other CSS blocks for each media.
Merge blocks if exists in both.

Declaration
public void Combine(CssData other)
Parameters
CssData other

the CSS data to combine with

ContainsCssBlock(String, String)

Check if there are css blocks for the given class selector.

Declaration
public bool ContainsCssBlock(string className, string media = "all")
Parameters
System.String className

the class selector to check for css blocks by

System.String media

optional: the css media type (default - all)

Returns
System.Boolean

true - has css blocks for the class, false - otherwise

GetCssBlock(String, String)

Get collection of css blocks for the requested class selector.
the className can be: class name, html element name, html element and class name (elm.class), hash tag with element id (#id).
returned all the blocks that word on the requested class selector, it can contain simple selector or hierarchy selector.

Declaration
public IEnumerable<CssBlock> GetCssBlock(string className, string media = "all")
Parameters
System.String className

the class selector to get css blocks by

System.String media

optional: the css media type (default - all)

Returns
System.Collections.Generic.IEnumerable<CssBlock>

collection of css blocks, empty collection if no blocks exists (never null)

Parse(RAdapter, String, Boolean)

Parse the given stylesheet to CssData object.
If combineWithDefault is true the parsed css blocks are added to the default css data (as defined by W3), merged if class name already exists. If false only the data in the given stylesheet is returned.

Declaration
public static CssData Parse(RAdapter adapter, string stylesheet, bool combineWithDefault = true)
Parameters
RAdapter adapter

Platform adapter

System.String stylesheet

the stylesheet source to parse

System.Boolean combineWithDefault

true - combine the parsed css data with default css data, false - return only the parsed css data

Returns
CssData

the parsed css data

See Also
http://www.w3.org/TR/CSS21/sample.html

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.