예제 #1
0
        public void AddRange(IEnumerable <T> collection)
        {
            if (collection == null)
            {
                throw new ArgumentException("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 void OnItemsAdded(CollectionItemBatchEventArgs <T> args)
 {
     Fire(ItemsAdded, args);
 }