AngleSharp by Florian Rappl

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

.NET API 1,175,040 bytes

 HtmlAnchorElement

Represents an anchor element.
using AngleSharp.Dom.Collections; using AngleSharp.Dom.Css; using AngleSharp.Html; namespace AngleSharp.Dom.Html { internal sealed class HtmlAnchorElement : HtmlElement, IHtmlAnchorElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IUrlUtilities { private readonly BoundLocation _location; private TokenList _relList; private SettableTokenList _ping; public string Charset { get { return GetOwnAttribute(AttributeNames.Charset); } set { SetOwnAttribute(AttributeNames.Charset, value); } } public string Download { get { return GetOwnAttribute(AttributeNames.Download); } set { SetOwnAttribute(AttributeNames.Download, value); } } public string Href { get { return _location.Href; } set { _location.Href = value; } } public string Hash { get { return _location.Hash; } set { _location.Hash = value; } } public string Host { get { return _location.Host; } set { _location.Host = value; } } public string HostName { get { return _location.HostName; } set { _location.HostName = value; } } public string PathName { get { return _location.PathName; } set { _location.PathName = value; } } public string Port { get { return _location.Port; } set { _location.Port = value; } } public string Protocol { get { return _location.Protocol; } set { _location.Protocol = value; } } public string UserName { get { return _location.UserName; } set { _location.UserName = value; } } public string Password { get { return _location.Password; } set { _location.Password = value; } } public string Search { get { return _location.Search; } set { _location.Search = value; } } public string Origin => _location.Origin; public string TargetLanguage { get { return GetOwnAttribute(AttributeNames.HrefLang); } set { SetOwnAttribute(AttributeNames.HrefLang, value); } } public string Media { get { return GetOwnAttribute(AttributeNames.Media); } set { SetOwnAttribute(AttributeNames.Media, value); } } public string Name { get { return GetOwnAttribute(AttributeNames.Name); } set { SetOwnAttribute(AttributeNames.Name, value); } } public string Relation { get { return GetOwnAttribute(AttributeNames.Rel); } set { SetOwnAttribute(AttributeNames.Rel, value); } } public ITokenList RelationList { get { if (_relList == null) { _relList = new TokenList(GetOwnAttribute(AttributeNames.Rel)); CreateBindings(_relList, AttributeNames.Rel); } return _relList; } } public ISettableTokenList Ping { get { if (_ping == null) { _ping = new SettableTokenList(GetOwnAttribute(AttributeNames.Ping)); CreateBindings(_ping, AttributeNames.Ping); } return _ping; } } public string Target { get { return GetOwnAttribute(AttributeNames.Target); } set { SetOwnAttribute(AttributeNames.Target, value); } } public string Text { get { return TextContent; } set { TextContent = value; } } public string Type { get { return GetOwnAttribute(AttributeNames.Type); } set { SetOwnAttribute(AttributeNames.Type, value); } } internal bool IsVisited { get; set; } internal bool IsActive { get; set; } public HtmlAnchorElement(Document owner, string prefix = null) : base(owner, Tags.A, prefix, NodeFlags.HtmlFormatting) { _location = new BoundLocation(this, AttributeNames.Href); } public override void DoFocus() { if (GetOwnAttribute(AttributeNames.Href) != null) base.IsFocused = true; } } }