Change episode default sorting to SeriesOrder descending
This commit is contained in:
parent
8a1b375f0d
commit
af8e1cd5ef
8 changed files with 26 additions and 23 deletions
|
|
@ -1,12 +1,20 @@
|
|||
using LibationUiBase.GridView;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace LibationWinForms.GridView
|
||||
{
|
||||
internal class RowComparer : RowComparerBase
|
||||
{
|
||||
public ListSortDirection? SortOrder { get; set; }
|
||||
public override string PropertyName { get; set; }
|
||||
protected override ListSortDirection? GetSortOrder() => SortOrder;
|
||||
public ListSortDirection SortOrder { get; set; } = ListSortDirection.Descending;
|
||||
public override string PropertyName { get; set; } = nameof(IGridEntry.DateAdded);
|
||||
protected override ListSortDirection GetSortOrder() => SortOrder;
|
||||
|
||||
/// <summary>
|
||||
/// Helper method for ordering grid entries
|
||||
/// </summary>
|
||||
public IOrderedEnumerable<IGridEntry> OrderEntries(IEnumerable<IGridEntry> entries)
|
||||
=> SortOrder is ListSortDirection.Descending ? entries.OrderDescending(this) : entries.Order(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue