Class CssBlock
- Namespace
- TheArtOfDev.HtmlRenderer.Core.Entities
- Assembly
- StockSharp.Xaml.dll
Represents a block of CSS property values.
Contains collection of key-value pairs that are CSS properties for specific css class.
Css class can be either custom or html tag name.
public sealed class CssBlock
- Inheritance
-
CssBlock
- Inherited Members
- Extension Methods
Remarks
To learn more about CSS blocks visit CSS spec: http://www.w3.org/TR/CSS21/syndata.html#block
Constructors
CssBlock(string, Dictionary<string, string>, List<CssBlockSelectorItem>, bool)
Creates a new block from the block's source
public CssBlock(string @class, Dictionary<string, string> properties, List<CssBlockSelectorItem> selectors = null, bool hover = false)
Parameters
class
stringthe name of the css class of the block
properties
Dictionary<string, string>the CSS block properties and values
selectors
List<CssBlockSelectorItem>optional: additional selectors to used in hierarchy
hover
booloptional: is the css block has :hover pseudo-class
Properties
Class
the name of the css class of the block
public string Class { get; }
Property Value
Hover
is the css block has :hover pseudo-class
public bool Hover { get; }
Property Value
Properties
Gets the CSS block properties and its values
public IDictionary<string, string> Properties { get; }
Property Value
Selectors
additional selectors to used in hierarchy (p className1 > className2)
public List<CssBlockSelectorItem> Selectors { get; }
Property Value
Methods
Clone()
Create deep copy of the CssBlock.
public CssBlock Clone()
Returns
- CssBlock
new CssBlock with same data
Equals(object)
Check if the two css blocks are the same (same class, selectors and properties).
public override bool Equals(object obj)
Parameters
obj
objectthe other block to compare to
Returns
- bool
true - the two blocks are the same, false - otherwise
Equals(CssBlock)
Check if the two css blocks are the same (same class, selectors and properties).
public bool Equals(CssBlock other)
Parameters
other
CssBlockthe other block to compare to
Returns
- bool
true - the two blocks are the same, false - otherwise
EqualsSelector(CssBlock)
Check if the selectors of the css blocks is the same.
public bool EqualsSelector(CssBlock other)
Parameters
other
CssBlockthe other block to compare to
Returns
- bool
true - the selectors on blocks are the same, false - otherwise
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()
Returns
Merge(CssBlock)
Merge the other block properties into this css block.
Other block properties can overwrite this block properties.
public void Merge(CssBlock other)
Parameters
other
CssBlockthe css block to merge with
ToString()
public override string ToString()