Class SegmentBase

The abstract base class used in EPiServers Segment classes.

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 abstract class SegmentBase : ISegment

Constructors

SegmentBase(String)

Constructor for the SegmentBase class.

Declaration
public SegmentBase(string name)
Parameters
Type Name Description
System.String name

Name of the segment.

Properties

Name

The name of a segment. It is used to determine if a specific segment should be used when routing.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Methods

AppendTrailingSlash(RequestContext, RouteValueDictionary)

Called for the last segment that outputs anything in virtualpath. The segment implementation can then decide wether a trailing slash should be added.

Declaration
public virtual bool AppendTrailingSlash(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.Boolean
Remarks

This base implementation returns true, meaning a trailing slash is added when the segment is last.

GetVirtualPathSegment(RequestContext, RouteValueDictionary)

Gets the string representation of this segments virtual path.

Declaration
public abstract 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.

GetVirtualPathSegment(RequestContext, RouteValueDictionary, HashSet<String>)

Gets the string representation of this segments virtual path.

Declaration
public virtual string GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values, HashSet<string> usedValues)
Parameters
Type Name Description
System.Web.Routing.RequestContext requestContext

The request

System.Web.Routing.RouteValueDictionary values

Custom values

System.Collections.Generic.HashSet<System.String> usedValues

Route values that are handled and should not be added to the query string.

Returns
Type Description
System.String

Virtual path from this segment.

Remarks

Adds this segment's Name to usedValues and calls GetVirtualPathSegment(RequestContext, RouteValueDictionary)

RouteDataMatch(SegmentContext)

Route incoming segment.

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

Routing context

Returns
Type Description
System.Boolean

True if the segment part matches the pattern

Implements

Extension Methods