Class LanguagePreferenceList

Implements a list with language codes and handles some special semantics with language strings

Inheritance
System.Object
System.Collections.Generic.List<System.String>
LanguagePreferenceList
Implements
System.Collections.Generic.IList<System.String>
System.Collections.Generic.ICollection<System.String>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<System.String>
System.Collections.Generic.IReadOnlyCollection<System.String>
System.Collections.Generic.IEnumerable<System.String>
System.Collections.IEnumerable
Inherited Members
System.Collections.Generic.List<System.String>.System.Collections.IList.get_Item(System.Int32)
System.Collections.Generic.List<System.String>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.Generic.List<System.String>.Add(System.String)
System.Collections.Generic.List<System.String>.System.Collections.IList.Add(System.Object)
System.Collections.Generic.List<System.String>.AddRange(System.Collections.Generic.IEnumerable<System.String>)
System.Collections.Generic.List<System.String>.AsReadOnly()
System.Collections.Generic.List<System.String>.BinarySearch(System.Int32, System.Int32, System.String, System.Collections.Generic.IComparer<System.String>)
System.Collections.Generic.List<System.String>.BinarySearch(System.String)
System.Collections.Generic.List<System.String>.BinarySearch(System.String, System.Collections.Generic.IComparer<System.String>)
System.Collections.Generic.List<System.String>.Clear()
System.Collections.Generic.List<System.String>.Contains(System.String)
System.Collections.Generic.List<System.String>.System.Collections.IList.Contains(System.Object)
System.Collections.Generic.List<System.String>.ConvertAll<TOutput>(System.Converter<System.String, TOutput>)
System.Collections.Generic.List<System.String>.CopyTo(System.String[])
System.Collections.Generic.List<System.String>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.Generic.List<System.String>.CopyTo(System.Int32, System.String[], System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.CopyTo(System.String[], System.Int32)
System.Collections.Generic.List<System.String>.Exists(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.Find(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindAll(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindIndex(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindIndex(System.Int32, System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindIndex(System.Int32, System.Int32, System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindLast(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindLastIndex(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindLastIndex(System.Int32, System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.FindLastIndex(System.Int32, System.Int32, System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.ForEach(System.Action<System.String>)
System.Collections.Generic.List<System.String>.GetEnumerator()
System.Collections.Generic.List<System.String>.System.Collections.Generic.IEnumerable<System.String>.GetEnumerator()
System.Collections.Generic.List<System.String>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.Generic.List<System.String>.GetRange(System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.IndexOf(System.String)
System.Collections.Generic.List<System.String>.System.Collections.IList.IndexOf(System.Object)
System.Collections.Generic.List<System.String>.IndexOf(System.String, System.Int32)
System.Collections.Generic.List<System.String>.IndexOf(System.String, System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.Insert(System.Int32, System.String)
System.Collections.Generic.List<System.String>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.Generic.List<System.String>.InsertRange(System.Int32, System.Collections.Generic.IEnumerable<System.String>)
System.Collections.Generic.List<System.String>.LastIndexOf(System.String)
System.Collections.Generic.List<System.String>.LastIndexOf(System.String, System.Int32)
System.Collections.Generic.List<System.String>.LastIndexOf(System.String, System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.Remove(System.String)
System.Collections.Generic.List<System.String>.System.Collections.IList.Remove(System.Object)
System.Collections.Generic.List<System.String>.RemoveAll(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.RemoveAt(System.Int32)
System.Collections.Generic.List<System.String>.RemoveRange(System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.Reverse()
System.Collections.Generic.List<System.String>.Reverse(System.Int32, System.Int32)
System.Collections.Generic.List<System.String>.Sort()
System.Collections.Generic.List<System.String>.Sort(System.Collections.Generic.IComparer<System.String>)
System.Collections.Generic.List<System.String>.Sort(System.Int32, System.Int32, System.Collections.Generic.IComparer<System.String>)
System.Collections.Generic.List<System.String>.Sort(System.Comparison<System.String>)
System.Collections.Generic.List<System.String>.ToArray()
System.Collections.Generic.List<System.String>.TrimExcess()
System.Collections.Generic.List<System.String>.TrueForAll(System.Predicate<System.String>)
System.Collections.Generic.List<System.String>.Capacity
System.Collections.Generic.List<System.String>.Count
System.Collections.Generic.List<System.String>.System.Collections.IList.IsFixedSize
System.Collections.Generic.List<System.String>.System.Collections.Generic.ICollection<System.String>.IsReadOnly
System.Collections.Generic.List<System.String>.System.Collections.IList.IsReadOnly
System.Collections.Generic.List<System.String>.System.Collections.ICollection.IsSynchronized
System.Collections.Generic.List<System.String>.System.Collections.ICollection.SyncRoot
System.Collections.Generic.List<System.String>.Item[System.Int32]
System.Collections.Generic.List<System.String>.System.Collections.IList.Item[System.Int32]
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.Globalization
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class LanguagePreferenceList : List<string>, IList<string>, ICollection<string>, IList, ICollection, IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable

Constructors

LanguagePreferenceList()

Declaration
public LanguagePreferenceList()

Methods

ConditionalAdd(String)

Conditionally adds the language if not already present in the list

Declaration
public void ConditionalAdd(string languageCode)
Parameters
Type Name Description
System.String languageCode

The language code.

Remarks

Any quality indicator will be removed before checking if the language already exists.

ConditionalAddCookie(HttpCookie)

Conditionally adds the language from the given cookie.

Declaration
public void ConditionalAddCookie(HttpCookie cookie)
Parameters
Type Name Description
System.Web.HttpCookie cookie

The cookie where the value contains the language code.

Remarks

Any quality indicator will be removed before checking if the language already exists.

ConditionalAddRange(IEnumerable<String>)

Conditionally adds a range of language code strings.

Declaration
public void ConditionalAddRange(IEnumerable<string> range)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> range

The strings to add.

RemoveQualityIndicator(String)

Removes the quality indicator from a language code.

Declaration
public static string RemoveQualityIndicator(string browserLanguageCode)
Parameters
Type Name Description
System.String browserLanguageCode

The browser language code.

Returns
Type Description
System.String

The language code without quality indicator.

Remarks

A browser may append a quality indicator to the language code to indicate the preference level for a specific language. For example a browser may send "en;q=0.7" and "sv;q=1.0" This means that the highest preference is for Swedish (1.0) and English is second preference. The use of quality indicators is not currently supported, EPiServer simply assumes that language codes are sent in preference order.

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods