15 lines
405 B
C#
15 lines
405 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace CaoCao.Editor
|
|
{
|
|
internal static class ExtensionMethods
|
|
{
|
|
internal static IOrderedEnumerable<T> Order<T, TKey>(this IEnumerable<T> source, Func<T, TKey> selector,
|
|
bool ascending)
|
|
{
|
|
return ascending ? source.OrderBy(selector) : source.OrderByDescending(selector);
|
|
}
|
|
}
|
|
} |