mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-04-17 10:51:41 +00:00
* Rename Ryujinx.UI.Common * Rename Ryujinx.UI.LocaleGenerator * Update in Files AboutWindow * Configuration State * Rename projects * Ryujinx/UI * Fix build * Main remaining inconsistencies * HLE.UI Namespace * HLE.UI Files * Namespace * Ryujinx.UI.Common.Configuration.UI * Ryujinx.UI.Common,Configuration.UI Files * More instances
32 lines
826 B
C#
32 lines
826 B
C#
using Ryujinx.UI.App.Common;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.Ava.UI.Models.Generic
|
|
{
|
|
internal class TimePlayedSortComparer : IComparer<ApplicationData>
|
|
{
|
|
public TimePlayedSortComparer() { }
|
|
public TimePlayedSortComparer(bool isAscending) { IsAscending = isAscending; }
|
|
|
|
public bool IsAscending { get; }
|
|
|
|
public int Compare(ApplicationData x, ApplicationData y)
|
|
{
|
|
TimeSpan aValue = TimeSpan.Zero, bValue = TimeSpan.Zero;
|
|
|
|
if (x?.TimePlayed != null)
|
|
{
|
|
aValue = x.TimePlayed;
|
|
}
|
|
|
|
if (y?.TimePlayed != null)
|
|
{
|
|
bValue = y.TimePlayed;
|
|
}
|
|
|
|
return (IsAscending ? 1 : -1) * TimeSpan.Compare(aValue, bValue);
|
|
}
|
|
}
|
|
}
|