add overload, and change the order of arguments
This commit is contained in:
parent
4cdbe8ce34
commit
1b3a81ad8d
@ -58,6 +58,7 @@ namespace ObservableCollections
|
||||
void SetToSourceCollection(int index, T value);
|
||||
IWritableSynchronizedViewList<TView> ToWritableViewList(WritableViewChangedEventHandler<T, TView> converter);
|
||||
INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged(WritableViewChangedEventHandler<T, TView> converter);
|
||||
INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged(ICollectionEventDispatcher? collectionEventDispatcher);
|
||||
INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged(WritableViewChangedEventHandler<T, TView> converter, ICollectionEventDispatcher? collectionEventDispatcher);
|
||||
}
|
||||
|
||||
|
@ -26,19 +26,22 @@ namespace ObservableCollections
|
||||
|
||||
public INotifyCollectionChangedSynchronizedViewList<T> ToWritableNotifyCollectionChanged(ICollectionEventDispatcher? collectionEventDispatcher)
|
||||
{
|
||||
return ToWritableNotifyCollectionChanged(static x => x, collectionEventDispatcher, static (T newView, T originalValue, ref bool setValue) =>
|
||||
return ToWritableNotifyCollectionChanged(
|
||||
static x => x,
|
||||
static (T newView, T originalValue, ref bool setValue) =>
|
||||
{
|
||||
setValue = true;
|
||||
return newView;
|
||||
});
|
||||
},
|
||||
collectionEventDispatcher);
|
||||
}
|
||||
|
||||
public INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged<TView>(Func<T, TView> transform, WritableViewChangedEventHandler<T, TView>? converter)
|
||||
{
|
||||
return ToWritableNotifyCollectionChanged(transform, null!);
|
||||
return ToWritableNotifyCollectionChanged(transform, converter, null!);
|
||||
}
|
||||
|
||||
public INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged<TView>(Func<T, TView> transform, ICollectionEventDispatcher? collectionEventDispatcher, WritableViewChangedEventHandler<T, TView>? converter)
|
||||
public INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged<TView>(Func<T, TView> transform, WritableViewChangedEventHandler<T, TView>? converter, ICollectionEventDispatcher? collectionEventDispatcher)
|
||||
{
|
||||
return new NonFilteredNotifyCollectionChangedSynchronizedViewList<T, TView>(CreateView(transform), collectionEventDispatcher, converter);
|
||||
}
|
||||
@ -367,9 +370,19 @@ namespace ObservableCollections
|
||||
return new NotifyCollectionChangedSynchronizedViewList<T, TView>(this, null, converter);
|
||||
}
|
||||
|
||||
public INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged(ICollectionEventDispatcher? collectionEventDispatcher)
|
||||
{
|
||||
return new NotifyCollectionChangedSynchronizedViewList<T, TView>(this, collectionEventDispatcher,
|
||||
static (TView newView, T originalValue, ref bool setValue) =>
|
||||
{
|
||||
setValue = true;
|
||||
return originalValue;
|
||||
});
|
||||
}
|
||||
|
||||
public INotifyCollectionChangedSynchronizedViewList<TView> ToWritableNotifyCollectionChanged(WritableViewChangedEventHandler<T, TView> converter, ICollectionEventDispatcher? collectionEventDispatcher)
|
||||
{
|
||||
return new NotifyCollectionChangedSynchronizedViewList<T, TView>(this, null, converter);
|
||||
return new NotifyCollectionChangedSynchronizedViewList<T, TView>(this, collectionEventDispatcher, converter);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user