Class Attr
- Namespace
- AngleSharp.Dom
- Assembly
- AngleSharp.dll
Represents a generic node attribute.
public sealed class Attr : IAttr, INode, IEventTarget, IMarkupFormattable, IEquatable<IAttr>
- Inheritance
-
Attr
- Implements
- Inherited Members
- Extension Methods
Constructors
Attr(string)
Creates a new attribute with the given local name.
public Attr(string localName)
Parameters
localName
stringThe local name of the attribute.
Attr(string, string)
Creates a new attribute with the given local name and value.
public Attr(string localName, string value)
Parameters
Attr(string?, string, string, string?)
Creates a new attribute with the given properties.
public Attr(string? prefix, string localName, string value, string? namespaceUri)
Parameters
prefix
stringThe prefix of the attribute.
localName
stringThe local name of the attribute.
value
stringThe value of the attribute.
namespaceUri
stringThe namespace of the attribute.
Properties
IsId
Gets if the attribute is an id attribute.
public bool IsId { get; }
Property Value
IsSpecified
Gets always true.
public bool IsSpecified { get; }
Property Value
LocalName
Gets the attribute's local name.
public string LocalName { get; }
Property Value
Name
Gets the attribute's fully qualified name.
public string Name { get; }
Property Value
NamespaceUri
Gets the attribute's namespace.
public string? NamespaceUri { get; }
Property Value
OwnerElement
Gets the owner of the attribute, if any.
public IElement? OwnerElement { get; }
Property Value
Prefix
Gets the attribute's prefix.
public string? Prefix { get; }
Property Value
Specified
Gets if the value is given or not.
public bool Specified { get; }
Property Value
Value
Gets the attribute's value.
public string Value { get; set; }
Property Value
Methods
Equals(IAttr?)
Checks if the attribute equals another attribute.
public bool Equals(IAttr? other)
Parameters
other
IAttrThe other attribute.
Returns
- bool
True if both are equivalent, otherwise false.
GetHashCode()
Computes the hash code of the attribute.
public override int GetHashCode()
Returns
- int
The computed hash code.