Class SoftLink
Reads and edits links defined in HTML.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class SoftLink : IEquatable<SoftLink>
Constructors
SoftLink()
Initializes a new instance of the SoftLink class with default values.
Declaration
public SoftLink()
Properties
FirstDateBroken
Date when the link was first found broken
Declaration
public DateTime? FirstDateBroken { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
HttpStatusCode
HttpStatus code if broken
Declaration
public HttpStatusCode? HttpStatusCode { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Net.HttpStatusCode> |
Id
Id of the soft link
Declaration
public int Id { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
LastCheckedDate
Date when the link was last checked
Declaration
public DateTime? LastCheckedDate { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
LinkMapper
Gets or sets the service used to resolve links.
Declaration
public Injected<IPermanentLinkMapper> LinkMapper { get; set; }
Property Value
Type | Description |
---|---|
Injected<IPermanentLinkMapper> |
LinkStatus
Current System.Net.WebExceptionStatus
Declaration
public WebExceptionStatus? LinkStatus { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Net.WebExceptionStatus> |
OwnerContentLink
Gets or sets the owner content link.
Declaration
public ContentReference OwnerContentLink { get; set; }
Property Value
Type | Description |
---|---|
ContentReference | The owner content link. |
OwnerLanguage
Gets or sets the owner language branch.
Declaration
public CultureInfo OwnerLanguage { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | The owner language branch. |
OwnerPageLink
Gets or sets the page link for the referencing page.
Declaration
[Obsolete("Use OwnerContentLink instead", true)]
public PageReference OwnerPageLink { get; set; }
Property Value
Type | Description |
---|---|
PageReference |
PageLink
Gets the page link for the referenced page.
Declaration
[Obsolete("Use ReferencedContentLink instead", true)]
public PageReference PageLink { get; }
Property Value
Type | Description |
---|---|
PageReference | The page link. |
Protocol
Gets the protocol part of the link.
Declaration
public string Protocol { get; }
Property Value
Type | Description |
---|---|
System.String |
ReferencedContentLink
Gets or sets the referenced content link.
Declaration
public ContentReference ReferencedContentLink { get; set; }
Property Value
Type | Description |
---|---|
ContentReference | The referenced content link. |
ReferencedLanguage
Gets or sets the referencedlanguage branch.
Declaration
public CultureInfo ReferencedLanguage { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | The referencedlanguage branch. |
SoftLinkType
Gets or sets the type of the referenced object.
Declaration
public ReferenceType SoftLinkType { get; set; }
Property Value
Type | Description |
---|---|
ReferenceType | The type of the soft link. |
UnresolvedUrl
Get or set the Url of the link The set will also affect the Protocol and PageLink properties
Declaration
public string UnresolvedUrl { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Url
Get or set the Url of the link The set will also affect the Protocol and PageLink properties
Declaration
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
ClearState()
Clears the checked state of the current SoftLink instance.
Declaration
public virtual void ClearState()
Equals(SoftLink)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(SoftLink other)
Parameters
Type | Name | Description |
---|---|---|
SoftLink | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Load(ContentReference)
Loads a collection of SoftLink objects for where the specified content link is the owner (OwnerPageLink).
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentLink | The content link to retrieve SoftLink objects for. |
Returns
Type | Description |
---|---|
SoftLinkCollection | A collection of SoftLink instances that will contain information about all links from the page specified by |
Load(UnifiedFile)
Loads the links that reference a specified file.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(UnifiedFile file)
Parameters
Type | Name | Description |
---|---|---|
UnifiedFile | file | The file. |
Returns
Type | Description |
---|---|
SoftLinkCollection | A collection of SoftLink instances that will contain information about all links that point to the file specified in |
Load(String)
Loads the links that reference the file specified with a path.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
Returns
Type | Description |
---|---|
SoftLinkCollection | A collection of SoftLink instances that will contain information about all links that point to the file specified in |
Load(String, Boolean)
Loads the links that reference the file specified with a path.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(string path, bool exactMatch)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
System.Boolean | exactMatch | if set to |
Returns
Type | Description |
---|---|
SoftLinkCollection | A collection of SoftLink instances that will contain information about all links that point to the file specified in |
LoadReferencing(ContentReference)
Loads a collection of SoftLink objects for where the specified page link is the target (PageLink). The result will contain information about all pages pointing to the page specified by contentLink
.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection LoadReferencing(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentLink | The content link to retrieve SoftLink objects for. |
Returns
Type | Description |
---|---|
SoftLinkCollection | A collection of SoftLink instances that will contain information about all links that point to the page specified by |
Save(ContentReference, CultureInfo, SoftLinkCollection)
Saves all the specified SoftLink instances with the same owner page link.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static void Save(ContentReference ownerContent, CultureInfo languageID, SoftLinkCollection coll)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | ownerContent | The owner content link. |
System.Globalization.CultureInfo | languageID | The language, specify null to re-save links for all languages |
SoftLinkCollection | coll | The collection of SoftLink instances. |
Save(SoftLinkCollection)
Saves the specified collection of SoftLink instances.
Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static void Save(SoftLinkCollection coll)
Parameters
Type | Name | Description |
---|---|---|
SoftLinkCollection | coll | A collection of SoftLink to save. |