November Happy Hour will be moved to Thursday December 5th.

Class FilterPropertySort

A filter to sort a PageDataCollection by the values for a property.

Inheritance
System.Object
FilterPropertySort
Implements
System.Collections.Generic.IComparer<PageData>
Namespace: EPiServer.Filters
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public class FilterPropertySort : PageFilterBase, IPageFilter, IContentFilter, IComparer<PageData>

Constructors

FilterPropertySort()

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort()

FilterPropertySort(String)

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort(string sortBy)
Parameters
Type Name Description
System.String sortBy

The name of the property that should be used to sort the pages.

FilterPropertySort(String, FilterSortDirection)

Initializes a new instance of the FilterPropertySort class.

Declaration
public FilterPropertySort(string sortBy, FilterSortDirection sortDirection)
Parameters
Type Name Description
System.String sortBy

The name of the property that should be used to sort the pages.

FilterSortDirection sortDirection

The sort direction.

Properties

CompareInfo

Define this object to do culture-sensitive string-comparison. When this System.Globalization.CompareInfo object is defined, all string-comparisons use this object.

Declaration
public CompareInfo CompareInfo { get; set; }
Property Value
Type Description
System.Globalization.CompareInfo
Remarks

Only strings are sorted using this object. All other datatypes are sorted using default culture.

SortBy

Gets or sets the name of the property that is used to sort the pages.

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

The name of the property that is used to sort the pages.

SortDirection

The sort direction.

Declaration
public FilterSortDirection SortDirection { get; set; }
Property Value
Type Description
FilterSortDirection

Methods

Compare(PageData, PageData)

Compares the specified pages.

Declaration
public int Compare(PageData page1, PageData page2)
Parameters
Type Name Description
PageData page1

The first page.

PageData page2

The second page.

Returns
Type Description
System.Int32

An integer with the results of the comparison.

Filter(PageDataCollection)

Filters the specified pages.

Declaration
public override void Filter(PageDataCollection pages)
Parameters
Type Name Description
PageDataCollection pages

The pages that should be filtered.

Overrides

ShouldFilter(IContent)

If the content should be filtered.

Declaration
public override bool ShouldFilter(IContent content)
Parameters
Type Name Description
IContent content
Returns
Type Description
System.Boolean

True if the filter will remove the page; otherwise false.

Overrides

ShouldFilter(PageData)

If the page should be filtered.

Declaration
public override bool ShouldFilter(PageData page)
Parameters
Type Name Description
PageData page

The page that you want to check.

Returns
Type Description
System.Boolean

True if the filter will remove the page; otherwise false.

Overrides
Remarks

FilterPropertySort does not support ShouldFilter method.

Implements

System.Collections.Generic.IComparer<>

Extension Methods