Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EntityList{T}"/> with the specified
        /// <paramref name="source"/>
        /// </summary>
        /// <param name="entitySet">The
        /// <see cref="EntitySet{T}"/> that backs this list. All
        /// items added or removed from this list will also be added or removed from the backing
        /// <see cref="EntitySet"/>.
        /// </param>
        /// <param name="source">The source collection used to populate this list</param>
        public EntityList(EntitySet <T> entitySet, IEnumerable <T> source)
        {
            if (entitySet == null)
            {
                throw new ArgumentNullException(nameof(entitySet));
            }

            _entitySet = entitySet;
            _weakCollectionChangedLister =
                WeakCollectionChangedListener.CreateIfNecessary(_entitySet, this);

            Source = source;
        }
 internal ListCollectionViewProxy(EntityCollection <T> source)
 {
     this._source = source;
     this._weakCollectionChangedLister =
         WeakCollectionChangedListener.CreateIfNecessary(this._source, this);
 }