Class LanguageSegment

Inheritance
System.Object
LanguageSegment
Implements
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.Web.Routing.Segments
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class LanguageSegment : SegmentBase, ISegment

Constructors

LanguageSegment(String, ILanguageSegmentMatcher, HostLanguageResolver, VirtualPathHostResolver, HostNameResolver)

Initializes a new instance of the LanguageSegment class.

Declaration
public LanguageSegment(string name, ILanguageSegmentMatcher languageSegmentMatcher, HostLanguageResolver hostLanguageResolver, VirtualPathHostResolver virtualPathHostResolver, HostNameResolver hostNameResolver)
Parameters
Type Name Description
System.String name
ILanguageSegmentMatcher languageSegmentMatcher
HostLanguageResolver hostLanguageResolver
VirtualPathHostResolver virtualPathHostResolver
HostNameResolver hostNameResolver

Properties

EnabledLanguages

Gets or sets the enabled languages.

Declaration
public IDictionary<string, CultureInfo> EnabledLanguages { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.String, System.Globalization.CultureInfo>

The enabled languages.

Remarks

If not explicitly set is Languages used.

StrictLanguageHandlingResolver

Gets or sets the strict language handling resolver.

Declaration
[Obsolete("The StrictLanguageRoutingResolver is set on SegmentContext")]
public Func<bool> StrictLanguageHandlingResolver { get; set; }
Property Value
Type Description
System.Func<System.Boolean>

The strict language handling resolver.

Remarks

This is exposed for testability purpose. At runtime it returns StrictLanguageRouting

Methods

CurrentlyRequestedHostMatchesLanguage(RequestContext, CultureInfo)

Declaration
public bool CurrentlyRequestedHostMatchesLanguage(RequestContext requestContext, CultureInfo language)
Parameters
Type Name Description
System.Web.Routing.RequestContext requestContext
System.Globalization.CultureInfo language
Returns
Type Description
System.Boolean

GetLanguage(RequestContext, RouteValueDictionary)

Declaration
[Obsolete("This method is no longer called, override GetVirtualPathSegment to change behavior")]
protected virtual string GetLanguage(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type Name Description
System.Web.Routing.RequestContext requestContext
System.Web.Routing.RouteValueDictionary values
Returns
Type Description
System.String

GetVirtualPathSegment(RequestContext, RouteValueDictionary)

Gets the string representation of this segments virtual path.

Declaration
public override string GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type Name Description
System.Web.Routing.RequestContext requestContext

The request

System.Web.Routing.RouteValueDictionary values

Custom values

Returns
Type Description
System.String

Virtual path from this segment.

Overrides

HandleNoLanguageFoundStrict(SegmentContext)

Determines how the case when no language is found and running with strict language routing.

Declaration
protected virtual bool HandleNoLanguageFoundStrict(SegmentContext context)
Parameters
Type Name Description
SegmentContext context

The context.

Returns
Type Description
System.Boolean

false

RouteDataMatch(SegmentContext)

Get the language segment from the url, if there is any and puts it in the RouteData collection.

Declaration
public override bool RouteDataMatch(SegmentContext context)
Parameters
Type Name Description
SegmentContext context

The routing context

Returns
Type Description
System.Boolean

True

Overrides

Implements

Extension Methods