Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Collections/3.3/ObservableCollection.cs
- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Collections/3.3/ObservableCollection.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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.