Class LanguageSegment
Implements
Inherited Members
Namespace: EPiServer.Web.Routing.Segments
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class LanguageSegment : SegmentBase, ISegment
Constructors
LanguageSegment(String, Func<RequestContext, RouteValueDictionary, String>, ILanguageSegmentMatcher, IUpdateCurrentLanguage, SiteDefinitionResolver, HostLanguageResolver)
Initializes a new instance of the LanguageSegment class.
Declaration
[Obsolete("Use constructor that does not take IUpdateCurrentLanguage")]
public LanguageSegment(string name, Func<RequestContext, RouteValueDictionary, string> baseUriResolver, ILanguageSegmentMatcher languageSegmentMatcher, IUpdateCurrentLanguage updateCurrentLanguage, SiteDefinitionResolver siteDefinitionResolver, HostLanguageResolver hostLanguageResolver)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Func<System.Web.Routing.RequestContext, System.Web.Routing.RouteValueDictionary, System.String> | baseUriResolver | The base URI resolver |
ILanguageSegmentMatcher | languageSegmentMatcher | The language segment. |
IUpdateCurrentLanguage | updateCurrentLanguage | A handler to update the current language setting. |
SiteDefinitionResolver | siteDefinitionResolver | The site definition resolver. |
HostLanguageResolver | hostLanguageResolver | The host language resolver. |
LanguageSegment(String, Func<RequestContext, RouteValueDictionary, String>, ILanguageSegmentMatcher, SiteDefinitionResolver, HostLanguageResolver)
Initializes a new instance of the LanguageSegment class.
Declaration
public LanguageSegment(string name, Func<RequestContext, RouteValueDictionary, string> baseUriResolver, ILanguageSegmentMatcher languageSegmentMatcher, SiteDefinitionResolver siteDefinitionResolver, HostLanguageResolver hostLanguageResolver)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Func<System.Web.Routing.RequestContext, System.Web.Routing.RouteValueDictionary, System.String> | baseUriResolver | The base URI resolver |
ILanguageSegmentMatcher | languageSegmentMatcher | The language segment. |
SiteDefinitionResolver | siteDefinitionResolver | The site definition resolver. |
HostLanguageResolver | hostLanguageResolver | The host language resolver. |
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 explixitly 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
GetLanguage(RequestContext, RouteValueDictionary)
Gets the language.
Declaration
protected virtual string GetLanguage(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
System.Web.Routing.RouteValueDictionary | values | The 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 |