Class LinkItem
Class that is used to represent and work with a html link.
Inheritance
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class LinkItem : Object, ICloneable, IEquatable<LinkItem>, IReferenceMap
Constructors
LinkItem()
Initializes a new instance of the LinkItem class.
Declaration
public LinkItem()
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 virtual 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 virtual string Href { get; set; }
Property Value
Type | Description |
---|---|
System.String | The href part of the link. |
LinkResolver
Gets or sets the service used to resolve links.
Declaration
public Injected<IUrlResolver> LinkResolver { get; set; }
Property Value
Type | Description |
---|---|
Injected<IUrlResolver> |
ReferencedPermanentLinkIds
Gets an System.Collections.Generic.IList<> of permanent link ids that are referenced from this property.
Declaration
public virtual IList<Guid> ReferencedPermanentLinkIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Guid> | An System.Collections.Generic.IList<> of permanent link ids that are referenced from this property. |
Target
Gets or sets the target part of the link.
Declaration
public virtual 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 virtual 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 virtual string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title part of the link. |
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. |
Equals(LinkItem)
Declaration
public bool Equals(LinkItem other)
Parameters
Type | Name | Description |
---|---|---|
LinkItem | other |
Returns
Type | Description |
---|---|
System.Boolean |
GetMappedHref()
Tries to get a mapped representation (that is a link with an absolute path) of the Href property; otherwise returns the Href.
Declaration
public virtual string GetMappedHref()
Returns
Type | Description |
---|---|
System.String | A mapped representation of the link. |
RemapPermanentLinkReferences(IDictionary<Guid, Guid>)
Remaps permanent links according to the provided link mapping.
Declaration
public virtual void RemapPermanentLinkReferences(IDictionary<Guid, Guid> idMap)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Guid, System.Guid> | idMap | The link mapping. |
ToMappedLink()
Creates an external representation of the link.
Declaration
public virtual string ToMappedLink()
Returns
Type | Description |
---|---|
System.String | An external representation of the link. |
ToPermanentLink()
Creates an internal representation of the link.
Declaration
public virtual string ToPermanentLink()
Returns
Type | Description |
---|---|
System.String | An internal representation of the link. |