SortedList Desc Order

Swapping y for x should do when comparing

class DescComparer<T> : IComparer<T>
{
    public int Compare(T x, T y)
    {
        if(x == null) return -1;
        if(y == null) return 1;
        return Comparer<T>.Default.Compare(y, x);
    }
}

and then this

var list = new SortedList<DateTime, string>(new DescComparer<DateTime>());

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)