Class RequestSegmentContext

Encapsulates information about a HTTP request that is used when determining segments during routing.

Inheritance
System.Object
RequestSegmentContext
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 RequestSegmentContext : SegmentContext

Constructors

RequestSegmentContext(HttpContextBase, RouteData)

Initializes a new instance of the SegmentContext class.

Declaration
public RequestSegmentContext(HttpContextBase httpContextBase, RouteData routeData)
Parameters
Type Name Description
System.Web.HttpContextBase httpContextBase

An object that contains information about the HTTP request.

System.Web.Routing.RouteData routeData

An object that contains information about the route that matched the current.

Exceptions
Type Condition
System.ArgumentNullException

httpContext or routeData is null.

RequestSegmentContext(HttpContextBase, RouteData, IUpdateCurrentLanguage)

Initializes a new instance of the SegmentContext class.

Declaration
public RequestSegmentContext(HttpContextBase httpContextBase, RouteData routeData, IUpdateCurrentLanguage updateCurrentLanguage)
Parameters
Type Name Description
System.Web.HttpContextBase httpContextBase

An object that contains information about the HTTP request.

System.Web.Routing.RouteData routeData

An object that contains information about the route that matched the current.

IUpdateCurrentLanguage updateCurrentLanguage

The update current language.

Exceptions
Type Condition
System.ArgumentNullException

httpContext or routeData is null.

Fields

CmsPathGetter

The function that returns the path to the cms editorial interface.

Declaration
public static Func<string> CmsPathGetter
Field Value
Type Description
System.Func<System.String>

CurrentContextModeGetter

Replace this function to return a specific context mode in tests.

Declaration
public static Func<ContextMode> CurrentContextModeGetter
Field Value
Type Description
System.Func<ContextMode>

EpiEditMode

Name on the query parameter indicating if the request is in edit mode.

Declaration
public const string EpiEditMode = "epieditmode"
Field Value
Type Description
System.String

Properties

ContextMode

Gets or sets the context mode for the route.

Declaration
public override ContextMode ContextMode { get; set; }
Property Value
Type Description
ContextMode

The context mode.

Overrides

CurrentContextMode

Gets the context mode for the current request.

Declaration
public static ContextMode CurrentContextMode { get; }
Property Value
Type Description
ContextMode

The context mode as defined in ContextMode.

Language

This property states the language for the request.

Declaration
public override string Language { get; set; }
Property Value
Type Description
System.String
Overrides

QueryString

Gets the query string for the route.

Declaration
public override NameValueCollection QueryString { get; }
Property Value
Type Description
System.Collections.Specialized.NameValueCollection

The query string.

Overrides

This property states the ContentReference for the route.

Declaration
public override ContentReference RoutedContentLink { get; set; }
Property Value
Type Description
ContentReference
Overrides

RoutedObject

Gets or sets the route data.

Declaration
public override object RoutedObject { get; set; }
Property Value
Type Description
System.Object

The route data.

Overrides

RoutedSiteDefinition

Gets or sets the site definition that matches the route.

Declaration
public override SiteDefinition RoutedSiteDefinition { get; set; }
Property Value
Type Description
SiteDefinition

The routed site definition.

Overrides
Remarks

Will update Current

Methods

Copy()

Copies this instance.

Declaration
public override SegmentContext Copy()
Returns
Type Description
SegmentContext
Overrides

GetCustomRouteData<T>(String)

Gets custom route data from context.

Declaration
public override T GetCustomRouteData<T>(string code)
Parameters
Type Name Description
System.String code

The code.

Returns
Type Description
T
Type Parameters
Name Description
T
Overrides

PermanentRedirect(String)

Does a permanent redirect.

Declaration
public override void PermanentRedirect(string url)
Parameters
Type Name Description
System.String url

The URL.

Overrides

SetCustomRouteData<T>(String, T)

Sets custom route data in context.

Declaration
public override void SetCustomRouteData<T>(string code, T value)
Parameters
Type Name Description
System.String code

The code.

T value

The value.

Type Parameters
Name Description
T
Overrides
EPiServer.Web.Routing.Segments.SegmentContext.SetCustomRouteData<T>(System.String, T)

TemporaryRedirect(String)

Does a temporary redirect.

Declaration
public override void TemporaryRedirect(string url)
Parameters
Type Name Description
System.String url

The URL.

Overrides

Extension Methods