AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.11" />

.NET API 1,230,848 bytes

 Attr

sealed class Attr : IAttr, IEquatable<IAttr>
Represents a generic node attribute.
using AngleSharp.Dom.Collections; using AngleSharp.Extensions; using AngleSharp.Html; using System; namespace AngleSharp.Dom { internal sealed class Attr : IAttr, IEquatable<IAttr> { private readonly string _localName; private readonly string _prefix; private readonly string _namespace; private string _value; internal NamedNodeMap Container { get; set; } public string Prefix => _prefix; public bool IsId { get { if (_prefix == null) return _localName.Isi(AttributeNames.Id); return false; } } public bool Specified => !string.IsNullOrEmpty(_value); public string Name { get { if (_prefix != null) return _prefix + ":" + _localName; return _localName; } } public string Value { get { return _value; } set { string value2 = _value; _value = value; Container?.RaiseChangedEvent(this, value, value2); } } public string LocalName => _localName; public string NamespaceUri => _namespace; internal Attr(string localName) : this(localName, string.Empty) { } internal Attr(string localName, string value) { _localName = localName; _value = value; } internal Attr(string prefix, string localName, string value, string namespaceUri) { _prefix = prefix; _localName = localName; _value = value; _namespace = namespaceUri; } public bool Equals(IAttr other) { if (Prefix.Is(other.Prefix) && NamespaceUri.Is(other.NamespaceUri)) return Value.Is(other.Value); return false; } public override int GetHashCode() { return (((1 * 31 + _localName.GetHashCode()) * 31 + (_value ?? string.Empty).GetHashCode()) * 31 + (_namespace ?? string.Empty).GetHashCode()) * 31 + (_prefix ?? string.Empty).GetHashCode(); } } }