Class Attr
Represents an HTML attribute.
Inheritance
- Object
- Attr
Implements
Declaration
public sealed class Attr : ValueType
Constructors
Attr(String)
Create a Boolean HTML attribute.
Declaration
public Attr(string name)
Parameters
Type | Name | Description |
---|---|---|
name |
The name of the attribute. |
Attr(String, String)
Create an HTML attribute.
Declaration
public Attr(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
name |
The name of the attribute. |
|
value |
The value. |
Methods
Equals(Attr)
Declaration
public bool Equals(Attr attr)
Parameters
Type | Name | Description |
---|---|---|
attr |
Returns
Type | Description |
---|---|
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
other |
Returns
Type | Description |
---|---|
FromValueTuple((String, String))
Create an HTML attribute.
Declaration
public static Attr FromValueTuple((string, string) nameValue)
Parameters
Type | Name | Description |
---|---|---|
nameValue |
The name and value of the attribute. |
Returns
Type | Description |
---|---|
An Attr. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Raw(String)
Create a Boolean HTML attribute without HTML-encoding the name first.
Declaration
public static Attr Raw(string name)
Parameters
Type | Name | Description |
---|---|---|
name |
The pre-encoded name. |
Returns
Type | Description |
---|---|
An HTML attribute. |
Raw(String, String)
Create an HTML attribute without HTML-encoding the name and value first.
Declaration
public static Attr Raw(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
name |
The pre-encoded name. |
|
value |
The pre-encoded value. |
Returns
Type | Description |
---|---|
An HTML attribute. |
Operators
Implicit((String, String) to Attr)
Create an HTML attribute.
Declaration
public static implicit operator Attr((string, string) nameValue)
Parameters
Type | Name | Description |
---|---|---|
nameValue |
The name and value of the attribute. |
Returns
Type | Description |
---|---|