BaseLinkRelation
Base type for the all link rel field types.
using AngleSharp.Dom;
using AngleSharp.Html.Dom;
using AngleSharp.Io.Processors;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace AngleSharp.Html.LinkRels
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class BaseLinkRelation
{
private readonly IHtmlLinkElement _link;
private readonly IRequestProcessor _processor;
public IRequestProcessor Processor => _processor;
public IHtmlLinkElement Link => _link;
[System.Runtime.CompilerServices.Nullable(2)]
public Url Url {
[System.Runtime.CompilerServices.NullableContext(2)]
get {
string href = _link.Href;
if (href == null || href.Length <= 0)
return null;
return new Url(_link.Href);
}
}
public BaseLinkRelation(IHtmlLinkElement link, IRequestProcessor processor)
{
_link = link;
_processor = processor;
}
public abstract Task LoadAsync();
}
}