November Happy Hour will be moved to Thursday December 5th.

Class LanguageSelectorContext

Context used by implementations of the ILanguageSelector interface

Inheritance
System.Object
LanguageSelectorContext
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.Core
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
[Obsolete("Simplify code in content providers to only use the Language property to get requested language (ILanguageSelector.Language). Removed usage of LanguageSelectorContext since fallback languages are now handled outside the provider.")]
public class LanguageSelectorContext

Constructors

LanguageSelectorContext(ContentReference)

Initializes a new instance of the LanguageSelectorContext class.

Declaration
public LanguageSelectorContext(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

LanguageSelectorContext(ContentReference, ILanguageBranchRepository, Func<ContentReference, LanguageSelector, IContent>)

Initializes a new instance of the LanguageSelectorContext class.

Declaration
public LanguageSelectorContext(ContentReference contentLink, ILanguageBranchRepository languageBranchRepository, Func<ContentReference, LanguageSelector, IContent> contentLangaugeLoader)
Parameters
Type Name Description
ContentReference contentLink

The content link.

ILanguageBranchRepository languageBranchRepository

The language branch repository used.

System.Func<ContentReference, LanguageSelector, IContent> contentLangaugeLoader

The content langauge loader.

LanguageSelectorContext(IContent)

Initializes a new instance of the LanguageSelectorContext class.

Declaration
public LanguageSelectorContext(IContent content)
Parameters
Type Name Description
IContent content

The content.

LanguageSelectorContext(IContent, ILanguageBranchRepository, Func<ContentReference, LanguageSelector, IContent>)

Initializes a new instance of the LanguageSelectorContext class.

Declaration
public LanguageSelectorContext(IContent content, ILanguageBranchRepository languageBranchRepository, Func<ContentReference, LanguageSelector, IContent> contentLangaugeLoader)
Parameters
Type Name Description
IContent content

The content.

ILanguageBranchRepository languageBranchRepository

The language branch repository used.

System.Func<ContentReference, LanguageSelector, IContent> contentLangaugeLoader

The content langauge loader.

Properties

ContentLanguage

Gets the language for the page.

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

The page language.

Gets the content link.

Declaration
public ContentReference ContentLink { get; }
Property Value
Type Description
ContentReference

MasterLanguageBranch

Gets the current page master language branch (only available on existing pages)

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

PageLanguage

Declaration
[Obsolete("Use ContentLanguage instead")]
public string PageLanguage { get; }
Property Value
Type Description
System.String

Gets the current page link (only available on existing pages)

Declaration
[Obsolete("Use ContentLink instead")]
public PageReference PageLink { get; }
Property Value
Type Description
PageReference

Gets the current page parent link

Declaration
[Obsolete("Use Parent instead")]
public PageReference ParentLink { get; }
Property Value
Type Description
PageReference

ParentReference

Declaration
public ContentReference ParentReference { get; }
Property Value
Type Description
ContentReference

SelectedLanguage

Gets or sets the language code that has been selected

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

The selected language.

SelectedLanguageBranch

Gets the language branch that has been selected.

Declaration
public LanguageBranch SelectedLanguageBranch { get; }
Property Value
Type Description
LanguageBranch
Remarks

Note that if SelectedLanguage is non-null and we cannot load this language as a language branch, an EPiServerException is thrown, i e an invalid language has been selected.

Methods

IsLanguagePublished(String)

Checks if a language has been published.

Declaration
public bool IsLanguagePublished(string language)
Parameters
Type Name Description
System.String language

The language to check

Returns
Type Description
System.Boolean

Extension Methods