BaseTagImpl<T> Class
Abstraction of Tag and EmptyTag.
public abstract class BaseTagImpl<T> : AbstractNode, BaseTag<T>
where T : BaseTag<T>
Type Parameters
The type of an HTML element.
- Inheritance
- Implements
Properties
Name | |
Kind |
(Inherited from Abstract |
Methods
Add |
Description copied from interface: BaseTag
|
Add |
Description copied from interface: BaseTag
|
Add |
Description copied from interface: BaseTag
|
With |
Description copied from interface: BaseTag
|
With |
Description copied from interface: BaseTag
|
Create(Func<Tag |
Gets a new element with the modifying function. |
Create |
Gets a new element with adding the specified attributes. |
Accept(NodeVisitor) |
Description copied from interface: Node (Inherited from Abstract |
ToString() |
(Inherited from Abstract |
ToString(FormatOptions) |
Description copied from interface: Node (Inherited from Abstract |
GetKind() |
Gets the kind of this node. (Inherited from Abstract |
Equals(object) | (Inherited from object) |
GetHashCode() | (Inherited from object) |
GetType() | (Inherited from object) |
MemberwiseClone() | (Inherited from object) |
Properties Detail
Name
public abstract string Name { get; }
Property Value
Implements
Methods Detail
AddAttributes((string Name, string Value)[])
Description copied from interface: BaseTag
Gets a new BaseTag<T> object with the specified attribute that has the specified value.
public T AddAttributes(params (string Name, string Value)[] attributes)
Parameters
- attributes
- (string Name, string Value)[]
Returns
Implements
AddClass(string[])
Description copied from interface: BaseTag
Gets a new BaseTag<T> object with the
class
attribute that has both the values of this object and the specified values.
public T AddClass(params string[] values)
Parameters
- values
- string[]
Returns
Implements
AddEmptyAttributes(string[])
Description copied from interface: BaseTag
Gets a new BaseTag<T> object with the specified empty attribute.
public T AddEmptyAttributes(params string[] attributeNames)
Parameters
- attributeNames
- string[]
Returns
Implements
Remarks
Description copied from interface: BaseTag
An invocation of this method of the form
tag.AddEmptyAttributes(n1, n2)
behaves in exactly the same way as the invocationtag.AddAttributes((n1, null), (n2, null))
.The web browser interprets the value of the empty attribute as the empty string implicitly. So, for example,
<input disabled>
is equivalent to<input disabled="">
. The former can be generated withAddEmptyAttributes("disabled")
orAddAttributes(("disabled", null))
, and the latter withAddAttributes(("disabled", ""))
.
WithClass(string[])
Description copied from interface: BaseTag
Gets a new BaseTag<T> object with the
class
attribute that has the specified values.
public T WithClass(params string[] values)
Parameters
- values
- string[]
Returns
Implements
WithId(string)
Description copied from interface: BaseTag
Gets a new BaseTag<T> object with the
id
attribute that has the specified value.
public T WithId(string id)
Parameters
- id
- string
Returns
Implements
Create(Func<TagStruct, TagStruct>)
Gets a new element with the modifying function.
protected abstract T Create(Func<TagStruct, TagStruct> modify)
Parameters
Returns
A new element.
CreateAddingAttributes(IEnumerable<(string Name, string Value)>)
Gets a new element with adding the specified attributes.
protected abstract T CreateAddingAttributes(IEnumerable<(string Name, string Value)> attributes)
Parameters
- attributes
- IEnumerable<(string Name, string Value)>
Tuples of the name and value representing an attribute. If the value of
the tuple is null
, it represents the empty attribute.
Returns
A new element.