Changeset 17034 for branches/2435-alglib_3_15/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs
- Timestamp:
- 06/25/19 23:14:06 (5 years ago)
- Location:
- branches/2435-alglib_3_15
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2435-alglib_3_15
- Property svn:mergeinfo changed
-
branches/2435-alglib_3_15/HeuristicLab.Core
- Property svn:mergeinfo changed
/branches/2931_OR-Tools_LP_MIP/HeuristicLab.Core (added) merged: 16373 /trunk/HeuristicLab.Core (added) merged: 16872,16907,16910,16933,16942,16945,16992,17009
- Property svn:mergeinfo changed
-
branches/2435-alglib_3_15/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs
r16565 r17034 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; 27 using HEAL.Attic;28 28 29 29 namespace HeuristicLab.Core { … … 108 108 109 109 /// <summary> 110 /// Sets the checked state of <paramref name="items"/> to <paramref name="checkedState"/>. 111 /// </summary> 112 /// <param name="items">The items to set the checked state for.</param> 113 /// <param name="checkedState">The new checked state of <paramref name="item"/></param> 114 public void SetItemCheckedState(IEnumerable<T> items, bool checkedState) { 115 var changed = new List<T>(); 116 foreach (var item in items) { 117 if (!this.checkedState.TryGetValue(item, out bool currentState)) throw new ArgumentException(); 118 if (currentState != checkedState) { 119 this.checkedState[item] = checkedState; 120 changed.Add(item); 121 } 122 } 123 if (changed.Count > 0) OnCheckedItemsChanged(changed); 124 } 125 126 /// <summary> 110 127 /// Adds a new <paramref name="item"/> with the given <paramref name="checkedState"/>. 111 128 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.