@@ -320,9 +320,9 @@ private int removeAll(Predicate<T> match, HashSet<BindableList<T>> appliedInstan
320
320
/// <param name="count">The count of items to be removed.</param>
321
321
/// <param name="newItems">The items to replace the removed items with.</param>
322
322
public void ReplaceRange ( int index , int count , IEnumerable < T > newItems )
323
- => replaceRange ( index , count , newItems as ICollection < T > ?? newItems . ToArray ( ) , new HashSet < BindableList < T > > ( ) ) ;
323
+ => replaceRange ( index , count , newItems as IList ?? newItems . ToArray ( ) , new HashSet < BindableList < T > > ( ) ) ;
324
324
325
- private void replaceRange ( int index , int count , ICollection < T > newItems , HashSet < BindableList < T > > appliedInstances )
325
+ private void replaceRange ( int index , int count , IList newItems , HashSet < BindableList < T > > appliedInstances )
326
326
{
327
327
if ( checkAlreadyApplied ( appliedInstances ) ) return ;
328
328
@@ -335,7 +335,7 @@ private void replaceRange(int index, int count, ICollection<T> newItems, HashSet
335
335
List < T > removedItems = CollectionChanged == null ? null : collection . GetRange ( index , count ) ;
336
336
337
337
collection . RemoveRange ( index , count ) ;
338
- collection . InsertRange ( index , newItems ) ;
338
+ collection . InsertRange ( index , ( IEnumerable < T > ) newItems ) ;
339
339
340
340
if ( bindings != null )
341
341
{
@@ -347,7 +347,7 @@ private void replaceRange(int index, int count, ICollection<T> newItems, HashSet
347
347
}
348
348
}
349
349
350
- CollectionChanged ? . Invoke ( this , new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Replace , ( IList ) newItems , removedItems ! , index ) ) ;
350
+ CollectionChanged ? . Invoke ( this , new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Replace , newItems , removedItems ! , index ) ) ;
351
351
}
352
352
353
353
/// <summary>
@@ -544,23 +544,23 @@ public virtual void UnbindFrom(IUnbindable them)
544
544
/// <param name="items">The collection whose items should be added to this collection.</param>
545
545
/// <exception cref="InvalidOperationException">Thrown if this collection is <see cref="Disabled"/></exception>
546
546
public void AddRange ( IEnumerable < T > items )
547
- => addRange ( items as ICollection < T > ?? items . ToArray ( ) , new HashSet < BindableList < T > > ( ) ) ;
547
+ => addRange ( items as IList ?? items . ToArray ( ) , new HashSet < BindableList < T > > ( ) ) ;
548
548
549
- private void addRange ( ICollection < T > items , HashSet < BindableList < T > > appliedInstances )
549
+ private void addRange ( IList items , HashSet < BindableList < T > > appliedInstances )
550
550
{
551
551
if ( checkAlreadyApplied ( appliedInstances ) ) return ;
552
552
553
553
ensureMutationAllowed ( ) ;
554
554
555
- collection . AddRange ( items ) ;
555
+ collection . AddRange ( ( IEnumerable < T > ) items ) ;
556
556
557
557
if ( bindings != null )
558
558
{
559
559
foreach ( var b in bindings )
560
560
b . addRange ( items , appliedInstances ) ;
561
561
}
562
562
563
- CollectionChanged ? . Invoke ( this , new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , ( IList ) items , collection . Count - items . Count ) ) ;
563
+ CollectionChanged ? . Invoke ( this , new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , items , collection . Count - items . Count ) ) ;
564
564
}
565
565
566
566
/// <summary>
0 commit comments