Esempio n. 1
0
        /// <summary>
        /// Clones the ReactiveList from all changes
        /// </summary>
        /// <typeparam name="TObject">The type of the object.</typeparam>
        /// <typeparam name="TKey">The type of the key.</typeparam>
        /// <param name="source">The source.</param>
        /// <param name="keySelector">The key selector.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">source
        /// or
        /// keySelector</exception>
        public static IObservable <IChangeSet <TObject, TKey> > ToObservableChangeSet <TObject, TKey>(this IReadOnlyReactiveList <TObject> source, Func <TObject, TKey> keySelector)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (keySelector == null)
            {
                throw new ArgumentNullException(nameof(keySelector));
            }

            return(source.ToObservableChangeSet <IReadOnlyReactiveList <TObject>, TObject>().AddKey(keySelector));
        }
Esempio n. 2
0
 /// <summary>
 /// Converts the Reactive List into an observable change set
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="source">The source.</param>
 /// <returns></returns>
 /// <exception cref="System.ArgumentNullException">source</exception>
 public static IObservable <IChangeSet <T> > ToObservableChangeSet <T>(this IReadOnlyReactiveList <T> source)
 {
     return(source.ToObservableChangeSet <IReadOnlyReactiveList <T>, T>());
 }