HtmlTag

TheArtOfDev.HtmlRenderer.Core.Dom

Constructores

HtmlTag(string, bool, Dictionary<string, string>)

Init.

name
the name of the html tag
isSingle
if the tag is single placed; in other words it doesn't have a separate closing tag;
attributes
collection of attributes and their value the html tag has

Propiedades

Attributes : Dictionary<string, string>

Gets collection of attributes and their value the html tag has

IsSingle : bool

Gets if the tag is single placed; in other words it doesn't have a separate closing tag; e.g. <br>

Name : string

Gets the name of this tag

Métodos

HasAttribute(string) : bool

Gets a boolean indicating if the attribute list has the specified attribute

attribute
attribute name to check if exists

Devuelve: true - attribute exists, false - otherwise

HasAttributes() : bool

is the html tag has attributes.

Devuelve: true - has attributes, false - otherwise

TryGetAttribute(string, string) : string

Get attribute value for given attribute name or null if not exists.

attribute
attribute name to get by
defaultValue
optional: value to return if attribute is not specified

Devuelve: attribute value or null if not found

Campos

_attributes : Dictionary<string, string>

collection of attributes and their value the html tag has

_isSingle : bool

if the tag is single placed; in other words it doesn't have a separate closing tag;

_name : string

the name of the html tag