- Timestamp:
- 07/23/17 00:52:14 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Collections/3.3/ObservableCollection.cs
r12012 r15280 20 20 #endregion 21 21 22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 22 23 using System; 23 24 using System.Collections; 24 25 using System.Collections.Generic; 25 26 using System.ComponentModel; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 using System.Linq; 27 28 28 29 namespace HeuristicLab.Collections { … … 96 97 public void AddRange(IEnumerable<T> collection) { 97 98 int capacity = list.Capacity; 98 int count = list.Count;99 list.AddRange( collection);100 if ( list.Count != count) {99 ICollection<T> items = collection as ICollection<T> ?? collection.ToList(); 100 list.AddRange(items); 101 if (items.Count > 0) { 101 102 if (list.Capacity != capacity) 102 103 OnPropertyChanged("Capacity"); 103 104 OnPropertyChanged("Count"); 104 OnItemsAdded( collection);105 OnItemsAdded(items); 105 106 } 106 107 }
Note: See TracChangeset
for help on using the changeset viewer.