Cysharp/ObservableCollections をベースにしたUI表示用の同期ビュー
修訂. | 87a8ee4d858ecff8f6b35b7fd7fc72a5882fadbf |
---|---|
大小 | 2,946 bytes |
時間 | 2022-10-20 15:32:38 |
作者 | yoshy |
Log Message | [MOD] ビュー破棄時のトレースログを無効化
|
using CleanAuLait.ObservableCollectionsMod.Internal;
using ObservableCollections;
namespace CleanAuLait.ObservableCollectionsMod
{
public static class ObservableCollectionsModExtensions
{
public static ISynchronizedCoupleView<T, TView> ToSynchronizedCoupleView<T, TView>(
this IObservableCollection<T> source, Func<T, TView> transform, bool reverse = false, bool disposeElement = true)
{
return new SynchronizedCoupleView<T, TView>(source, transform, reverse, disposeElement);
}
public static ISortableSynchronizedCoupleView<T, TKey, TView> ToSortableSynchronizedCoupleView<T, TKey, TView>(
this IObservableCollection<T> source,
Func<T, TKey> identitySelector, Func<T, TView> transform, IComparer<(TKey, T, TView)> comparer,
bool disposeElement = true)
where TKey : notnull
{
return new SortableSynchronizedCoupleView<T, TKey, TView>(source, identitySelector, transform, comparer, disposeElement);
}
public static ISynchronizedSingleView<T, TView> ToSynchronizedSingleView<T, TView>(
this ISynchronizedCoupleView<T, TView> parent, bool disposeParent = true)
{
return new SynchronizedSingleView<T, TView>(parent, disposeParent);
}
public static IComparer<(TKey, T, TView)> CreateValueComparer<T, TKey, TView, TValueColumn>(
this ISortableSynchronizedCoupleView<T, TKey, TView> view, Func<T, TValueColumn> selector, bool ascending = true) where TKey: notnull
{
return SortableSynchronizedCoupleView<T, TKey, TView>.CreateValueComparer(selector, ascending);
}
public static IComparer<(TKey, T, TView)> CreateViewComparer<TKey, T, TView, TViewColumn>(
this ISortableSynchronizedCoupleView<T, TKey, TView> view, Func<TView, TViewColumn> selector, bool ascending = true) where TKey : notnull
{
return SortableSynchronizedCoupleView<T, TKey, TView>.CreateViewComparer(selector, ascending);
}
public static IComparer<(TKey, T, TView)> CreateMultiValueComparer<TKey, T, TView, TValueColumn>(
this ISortableSynchronizedCoupleView<T, TKey, TView> view, IEnumerable<Func<T, TValueColumn>> selectors, bool ascending = true) where TKey : notnull
{
return SortableSynchronizedCoupleView<T, TKey, TView>.CreateMultiValueComparer(selectors, ascending);
}
public static IComparer<(TKey, T, TView)> CreateMultiViewComparer<TKey, T, TView, TViewColumn>(
this ISortableSynchronizedCoupleView<T, TKey, TView> view, IEnumerable<Func<TView, TViewColumn>> selectors, bool ascending = true) where TKey : notnull
{
return SortableSynchronizedCoupleView<T, TKey, TView>.CreateMultiViewComparer(selectors, ascending);
}
}
}