Changeset 17226 for branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs
- Timestamp:
- 08/29/19 15:57:35 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Core
- Property svn:mergeinfo changed
/branches/2435-alglib_3_15/HeuristicLab.Core (added) merged: 17034 /trunk/HeuristicLab.Core merged: 16992,17009,17037,17180,17184
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs
r16723 r17226 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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.