Exemplo n.º 1
0
 public static CompositeDisposable KeepCollectionInSync2 <T, T2>(this IReactiveList <T> list, IList <T2> destination,
                                                                 Func <T, bool> filter = null) where T : T2
 {
     if (list == null)
     {
         throw new ArgumentNullException(nameof(list));
     }
     if (destination == null)
     {
         throw new ArgumentNullException(nameof(destination));
     }
     lock (list) {
         list.SyncCollection2Locked(destination, filter);
         return(list.TrackChanges(x => destination.Add(x), x => destination.Remove(x),
                                  reset => reset.SyncCollection2Locked(destination), filter));
     }
 }