HtmlTagAttributes Struct
Definition
The attributes of a single HTML tag, handed to an Avalonia.Controls.Documents.Serialization.Html.IHtmlTagHandler.
public struct HtmlTagAttributes
Remarks
Names and values are spans into the tag text the tokenizer is currently holding, so reading them allocates nothing. The spans are only valid for the duration of the handler callback; call ReadOnlySpan<T>.ToString on anything that has to outlive it.
Methods
| Name | Description |
|---|---|
| GetName | Gets the name of the attribute at index, in the casing the document used. |
| GetValue | Gets the value of the attribute at index with the surrounding quotes stripped. Empty for a boolean attribute such as disabled. |
| TryGetValue | No summary available. |
GetName Method
Gets the name of the attribute at index, in the casing the document used.
public ReadOnlySpan<char> GetName(int index)
Parameters
index int
The zero-based attribute index.
Returns
ReadOnlySpan<char>
Exceptions
GetValue Method
Gets the value of the attribute at index with the surrounding quotes
stripped. Empty for a boolean attribute such as disabled.
public ReadOnlySpan<char> GetValue(int index)
Parameters
index int
The zero-based attribute index.
Returns
ReadOnlySpan<char>
Exceptions
TryGetValue Method
public bool TryGetValue(ReadOnlySpan<char> name, ReadOnlySpan<char>& value)
Parameters
name ReadOnlySpan<char>
value ReadOnlySpan<char>&
Returns
bool
Properties
| Name | Description |
|---|---|
| Count | Gets the number of attributes on the tag. |
Count Property
Gets the number of attributes on the tag.
public int Count { get; set; }