mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-15 08:56:56 +02:00
Updated Utilities
This commit is contained in:
parent
0ee776be98
commit
c73761d36c
6 changed files with 289 additions and 21 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
|
@ -66,5 +67,35 @@ namespace Utilities
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
new public void Sort()
|
||||
{
|
||||
this.Sort(Comparer<TKey>.Default);
|
||||
}
|
||||
|
||||
public void Sort(ListSortDirection sortDirection)
|
||||
{
|
||||
Sort(Comparer<TKey>.Default, sortDirection);
|
||||
}
|
||||
|
||||
public void Sort(IComparer<TKey> comparer, ListSortDirection sortDirection)
|
||||
{
|
||||
if (sortDirection == ListSortDirection.Ascending)
|
||||
{
|
||||
Sort(comparer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Sort(new ReverseComparer<TKey>(comparer));
|
||||
}
|
||||
}
|
||||
|
||||
public void Sort(IComparer<TKey> comparer)
|
||||
{
|
||||
this.Sort(delegate(KeyValuePair<TKey, TValue> a, KeyValuePair<TKey, TValue> b)
|
||||
{
|
||||
return comparer.Compare(a.Key, b.Key);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue