Class LanguageBranch
Represents a language that can be used in globalized solutions.
Inheritance
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class LanguageBranch : Object, IReadOnly<LanguageBranch>, IReadOnly
Constructors
LanguageBranch()
Initializes a new instance of the LanguageBranch class.
Declaration
public LanguageBranch()
LanguageBranch(CultureInfo)
Initializes a new instance of the LanguageBranch class.
Declaration
public LanguageBranch(CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | The culture of the language branch. |
LanguageBranch(String)
Initializes a new instance of the LanguageBranch class.
Declaration
public LanguageBranch(string languageID)
Parameters
Type | Name | Description |
---|---|---|
System.String | languageID | The language of the branch. |
Fields
CacheKey
String used as cache key for language branches.
Declaration
public const string CacheKey = "EP:LanguageBranch"
Field Value
Type | Description |
---|---|
System.String |
Properties
ACL
Gets or sets the AccessControlList for this language.
Declaration
public AccessControlList ACL { get; set; }
Property Value
Type | Description |
---|---|
AccessControlList |
Culture
Gets or sets the culture for this language branch.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo |
Enabled
Gets or sets a value indicating if this language branch is enabled.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ID
Gets or sets the unique identifier of this language branch.
Declaration
public int ID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsReadOnly
Indicates whether the current object instance is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LanguageID
Gets the language name of the current branch, for example "en"
Declaration
public string LanguageID { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Note that this is the Name property of a CultureInfo object.
Name
Gets or sets the display name of this language.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Unless explicitly set, this property returns the NativeName of the Culture property.
RawIconPath
Gets or sets the raw flag icon path.
Declaration
public string RawIconPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ResolvedIconPath
Gets the icon path.
Declaration
public string ResolvedIconPath { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Use this property to get path to Flag outside admin/edit. Uses UriSupport.ResolveUrlBySettings to resolve path to flag.
SortIndex
Gets or sets the sort index used when listing language branches.
Declaration
public int SortIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
URLSegment
Gets or sets a custom string that should be used in URL segments.
Declaration
public string URLSegment { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateWritableClone()
Declaration
public virtual LanguageBranch CreateWritableClone()
Returns
Type | Description |
---|---|
LanguageBranch |
MakeReadOnly()
Changes the object instance into a read-only object.
Declaration
public virtual void MakeReadOnly()
Remarks
After calling this method, any attempt to change the object instance or any contained object will generate a System.NotSupportedException. I.e. the semantics is "deep read-only".
Note! After setting an object to read-only it is not possible to revert back to read-write mode. You will have to call the CreateWritableClone method to get a copy that can be modified.
QueryEditAccessRights(IPrincipal)
Queries if the user has edit access rights to the language branch.
Declaration
public virtual bool QueryEditAccessRights(IPrincipal user)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | user | The user. |
Returns
Type | Description |
---|---|
System.Boolean | True if the user has edit access to the language; otherwise false. |
ValidateLanguageEdititingAccessRights(IPrincipal)
Validates that the user has access rights to edit the page in the given language.
Declaration
public virtual void ValidateLanguageEdititingAccessRights(IPrincipal user)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | user | The user. |
Explicit Interface Implementations
IReadOnly.CreateWritableClone()
Declaration
object IReadOnly.CreateWritableClone()
Returns
Type | Description |
---|---|
System.Object |