Catel.Collections.CollectionExtensions

Topics: Feature requests
Jan 16, 2014 at 10:00 AM
Hello

I see there is a class to extend the collection. Nice.
I need the method: AddRange()

But I need a second method: RemoveRange(). Is it possible to add this method to this extenssions.

maybe in this way
public static void RemoveRange<T>(this ObservableCollection<T> collection, IEnumerable<T> range)
        {
            Argument.IsNotNull("collection", collection);
            Argument.IsNotNull("range", range);
            foreach (T local in range)
            {
                collection.Remove(local);
            }
        }
Coordinator
Jan 16, 2014 at 10:01 AM
Yes, no problem. Do you know how pull requests work on github? Then you can implement it and we can automatically accept it.
Jan 16, 2014 at 11:04 AM
Hello. Thanks for the answer.
Never do this before.
Coordinator
Jan 16, 2014 at 11:06 AM
Please see this guide for all the details.

It can be a learning curve, but then you can simply code your ideas and submit them. We can then automatically accept them.
Jan 16, 2014 at 1:34 PM
Ok. But one additional question. Why do you use ObservableCollection instead of ICollection?
Coordinator
Jan 16, 2014 at 2:03 PM
Regular collections (List<T>) already has AddRange and RemoveRange:

http://msdn.microsoft.com/en-us/library/z883w3dc(v=vs.110).aspx