remove IComparable constraint
This commit is contained in:
parent
35c4d2eb4d
commit
aee0784acf
@ -51,19 +51,19 @@ namespace ObservableCollections
|
||||
public static class ObservableCollectionsExtensions
|
||||
{
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, IComparer<T> comparer)
|
||||
where TKey : IComparable<TKey>
|
||||
|
||||
{
|
||||
return new SortedView<T, TKey, TView>(source, identitySelector, transform, comparer);
|
||||
}
|
||||
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, IComparer<TView> viewComparer)
|
||||
where TKey : IComparable<TKey>
|
||||
|
||||
{
|
||||
return new SortedViewViewComparer<T, TKey, TView>(source, identitySelector, transform, viewComparer);
|
||||
}
|
||||
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView, TCompare>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, Func<T, TCompare> compareSelector, bool ascending = true)
|
||||
where TKey : IComparable<TKey>
|
||||
|
||||
{
|
||||
return source.CreateSortedView(identitySelector, transform, new AnonymousComparer<T, TCompare>(compareSelector, ascending));
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||
namespace ObservableCollections.Internal
|
||||
{
|
||||
internal class SortedView<T, TKey, TView> : ISynchronizedView<T, TView>
|
||||
where TKey : IComparable<TKey>
|
||||
|
||||
{
|
||||
readonly IObservableCollection<T> source;
|
||||
readonly Func<T, TView> transform;
|
||||
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||
namespace ObservableCollections.Internal
|
||||
{
|
||||
internal class SortedViewViewComparer<T, TKey, TView> : ISynchronizedView<T, TView>
|
||||
where TKey : IComparable<TKey>
|
||||
|
||||
{
|
||||
readonly IObservableCollection<T> source;
|
||||
readonly Func<T, TView> transform;
|
||||
|
@ -51,19 +51,19 @@ namespace ObservableCollections
|
||||
public static class ObservableCollectionsExtensions
|
||||
{
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, IComparer<T> comparer)
|
||||
where TKey : notnull, IComparable<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
return new SortedView<T, TKey, TView>(source, identitySelector, transform, comparer);
|
||||
}
|
||||
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, IComparer<TView> viewComparer)
|
||||
where TKey : notnull, IComparable<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
return new SortedViewViewComparer<T, TKey, TView>(source, identitySelector, transform, viewComparer);
|
||||
}
|
||||
|
||||
public static ISynchronizedView<T, TView> CreateSortedView<T, TKey, TView, TCompare>(this IObservableCollection<T> source, Func<T, TKey> identitySelector, Func<T, TView> transform, Func<T, TCompare> compareSelector, bool ascending = true)
|
||||
where TKey : notnull, IComparable<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
return source.CreateSortedView(identitySelector, transform, new AnonymousComparer<T, TCompare>(compareSelector, ascending));
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||
namespace ObservableCollections.Internal
|
||||
{
|
||||
internal class SortedView<T, TKey, TView> : ISynchronizedView<T, TView>
|
||||
where TKey : notnull, IComparable<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
readonly IObservableCollection<T> source;
|
||||
readonly Func<T, TView> transform;
|
||||
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||
namespace ObservableCollections.Internal
|
||||
{
|
||||
internal class SortedViewViewComparer<T, TKey, TView> : ISynchronizedView<T, TView>
|
||||
where TKey : notnull, IComparable<TKey>
|
||||
where TKey : notnull
|
||||
{
|
||||
readonly IObservableCollection<T> source;
|
||||
readonly Func<T, TView> transform;
|
||||
|
Loading…
x
Reference in New Issue
Block a user