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(); }
protected virtual void OnItemsAdded(CollectionItemBatchEventArgs <T> args) { Fire(ItemsAdded, args); }
protected void OnItemsAdding(CollectionItemBatchEventArgs <T> args) { Fire(ItemsAdding, args); }