SaaS CMS has officially launched! Learn more now.

Class LinkItem

Class that is used to represent and work with a html link.

Inheritance
System.Object
LinkItem
Implements
System.ICloneable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 7.19.2
Syntax
public class LinkItem : ICloneable

Constructors

LinkItem()

Initializes a new instance of the LinkItem class.

Declaration
public LinkItem()

LinkItem(Func<String, Boolean>)

Declaration
[Obsolete("Use the overload without a function instead.", false)]
public LinkItem(Func<string, bool> urlExists)
Parameters
Type Name Description
System.Func<System.String, System.Boolean> urlExists

LinkItem(XmlNode)

Initializes a new instance of the LinkItem class.

Declaration
public LinkItem(XmlNode anchorNode)
Parameters
Type Name Description
System.Xml.XmlNode anchorNode

An xml node that represents an anchor.

Properties

Attributes

Gets the link attributes.

Declaration
public Dictionary<string, string> Attributes { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>

The link attributes.

Href

Gets or sets the href part of the link.

Declaration
public string Href { get; set; }
Property Value
Type Description
System.String

The href part of the link.

Langauge

Gets the language from the link item.

Declaration
[Obsolete("Misspelled property, please use Language instead")]
public string Langauge { get; }
Property Value
Type Description
System.String

The language.

Remarks

In case no language is specified PreferredCulture is returned.

Language

Gets the language from the link item.

Declaration
public string Language { get; }
Property Value
Type Description
System.String

The language.

Remarks

In case no language is specified PreferredCulture is returned.

LinkMapper

Gets or sets the service used to resolve links.

Declaration
[Obsolete("Use UrlResolver instead.")]
public Injected<IPermanentLinkMapper> LinkMapper { get; set; }
Property Value
Type Description
Injected<IPermanentLinkMapper>

Target

Gets or sets the target part of the link.

Declaration
public string Target { get; set; }
Property Value
Type Description
System.String

The target part of the link.

Text

Gets or sets the text part of the link.

Declaration
public string Text { get; set; }
Property Value
Type Description
System.String

The text part of the link.

Title

Gets or sets the title part of the link.

Declaration
public string Title { get; set; }
Property Value
Type Description
System.String

The title part of the link.

UrlResolver

Gets or sets the service used to resolve links.

Declaration
public Injected<UrlResolver> UrlResolver { get; set; }
Property Value
Type Description
Injected<UrlResolver>

Methods

Clone()

Creates a new object that is a copy of the current instance.

Declaration
public object Clone()
Returns
Type Description
System.Object

A new object that is a copy of this instance.

GetMappedHref()

Tries to get a mapped representation of the Href property; otherwise returns the Href.

Declaration
public string GetMappedHref()
Returns
Type Description
System.String

A mapped representation of the link.

GetMappedHref(Boolean)

Tries to get a mapped representation of the Href property; otherwise returns the Href.

Declaration
[Obsolete("Use the overload of GetMappedHref without any parameters.", false)]
public string GetMappedHref(bool addPreferredLanguageIfEmpty)
Parameters
Type Name Description
System.Boolean addPreferredLanguageIfEmpty

If the preferred language should be added when no specific language code is present.

Returns
Type Description
System.String

A mapped representation of the link.

Creates an external representation of the link.

Declaration
public string ToMappedLink()
Returns
Type Description
System.String

An external representation of the link.

Creates an external representation of the link.

Declaration
[Obsolete("Use the overload of ToMappedLink without any parameters.", false)]
public string ToMappedLink(bool addPreferredLanguageIfEmpty)
Parameters
Type Name Description
System.Boolean addPreferredLanguageIfEmpty

If the preferred language should be added when no specific language code is present.

Returns
Type Description
System.String

An external representation of the link.

Creates an internal representation of the link.

Declaration
public string ToPermanentLink()
Returns
Type Description
System.String

An internal representation of the link.

Implements

System.ICloneable

Extension Methods