コード例 #1
0
        public void AddRange(IEnumerable <T> collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            var items = collection.ToArray();

            if (items.Length == 0)
            {
                return;
            }

            foreach (var item in items)
            {
                ValidateItem(item);
            }

            var args = new CollectionItemBatchEventArgs <T>(items);

            OnItemsAdding(args);

            ((List <T>)Items).AddRange(items);

            OnItemsAdded(args);
            OnChanged();
        }
コード例 #2
0
 protected virtual void OnItemsAdded(CollectionItemBatchEventArgs <T> args)
 {
     Fire(ItemsAdded, args);
 }
コード例 #3
0
 protected void OnItemsAdding(CollectionItemBatchEventArgs <T> args)
 {
     Fire(ItemsAdding, args);
 }