Table of Contents

Class DefaultLinkRelationFactory

Namespace
AngleSharp.Html
Assembly
AngleSharp.dll

Provides string to Relation instance mappings.

public class DefaultLinkRelationFactory : ILinkRelationFactory
Inheritance
DefaultLinkRelationFactory
Implements
Inherited Members
Extension Methods

Constructors

DefaultLinkRelationFactory()

public DefaultLinkRelationFactory()

Methods

Create(IHtmlLinkElement, string?)

Creates an LinkRel provider for the provided element.

public BaseLinkRelation? Create(IHtmlLinkElement link, string? rel)

Parameters

link IHtmlLinkElement

The link element.

rel string

The current value of the rel attribute.

Returns

BaseLinkRelation

The LinkRel provider instance or null.

CreateDefault(IHtmlLinkElement, string?)

Creates the default LinkRel provider for the given link element and relation. By default this is null.

protected virtual BaseLinkRelation? CreateDefault(IHtmlLinkElement link, string? rel)

Parameters

link IHtmlLinkElement

The link element.

rel string

The current value of the rel attribute.

Returns

BaseLinkRelation

The LinkRel provider instance or null.

Register(string, Creator)

Registers a new creator for the specified relation. Throws an exception if another creator for the given relation is already added.

public void Register(string rel, DefaultLinkRelationFactory.Creator creator)

Parameters

rel string

The relation value.

creator DefaultLinkRelationFactory.Creator

The creator to invoke.

Unregister(string)

Unregisters an existing creator for the given relation.

public DefaultLinkRelationFactory.Creator? Unregister(string rel)

Parameters

rel string

The relation value.

Returns

DefaultLinkRelationFactory.Creator

The registered creator, if any.