- Timestamp:
- 12/21/10 16:08:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
r4888 r5150 123 123 } 124 124 columnNameCache = null; 125 OnColumnsChanged(); 125 126 OnColumnNamesChanged(); 126 127 rowNamesCache = null; 127 128 base.OnCollectionReset(items, oldItems); 129 OnRowsChanged(); 128 130 OnRowNamesChanged(); 129 131 OnReset(); … … 131 133 } 132 134 protected override void OnItemsAdded(IEnumerable<IRun> items) { 133 bool column NamesChanged = false;135 bool columnsChanged = false; 134 136 foreach (IRun run in items) { 135 137 foreach (KeyValuePair<string, IItem> parameter in run.Parameters) 136 column NamesChanged |= AddParameter(parameter.Key, parameter.Value);138 columnsChanged |= AddParameter(parameter.Key, parameter.Value); 137 139 foreach (KeyValuePair<string, IItem> result in run.Results) 138 column NamesChanged |= AddResult(result.Key, result.Value);139 } 140 if (column NamesChanged) columnNameCache = null;140 columnsChanged |= AddResult(result.Key, result.Value); 141 } 142 if (columnsChanged) columnNameCache = null; 141 143 rowNamesCache = null; 142 144 base.OnItemsAdded(items); 143 145 OnReset(); 146 OnRowsChanged(); 144 147 OnRowNamesChanged(); 145 if (columnNamesChanged) OnColumnNamesChanged(); 148 if (columnsChanged) { 149 OnColumnsChanged(); 150 OnColumnNamesChanged(); 151 } 146 152 UpdateFiltering(false); 147 153 } 148 154 protected override void OnItemsRemoved(IEnumerable<IRun> items) { 149 bool column NamesChanged = false;155 bool columnsChanged = false; 150 156 foreach (IRun run in items) { 151 157 foreach (string parameterName in run.Parameters.Keys) 152 column NamesChanged |= RemoveParameterName(parameterName);158 columnsChanged |= RemoveParameterName(parameterName); 153 159 foreach (string resultName in run.Results.Keys) 154 column NamesChanged |= RemoveResultName(resultName);155 } 156 if (column NamesChanged) columnNameCache = null;160 columnsChanged |= RemoveResultName(resultName); 161 } 162 if (columnsChanged) columnNameCache = null; 157 163 rowNamesCache = null; 158 164 base.OnItemsRemoved(items); 159 165 OnReset(); 160 166 OnRowNamesChanged(); 161 if (columnNamesChanged) OnColumnNamesChanged(); 167 if (columnsChanged) { 168 OnColumnsChanged(); 169 OnColumnNamesChanged(); 170 } 162 171 } 163 172 … … 287 296 OnToStringChanged(); 288 297 } 298 public event EventHandler ColumnsChanged; 299 protected virtual void OnColumnsChanged() { 300 var handler = ColumnsChanged; 301 if (handler != null) handler(this, EventArgs.Empty); 302 } 303 public event EventHandler RowsChanged; 304 protected virtual void OnRowsChanged() { 305 var handler = RowsChanged; 306 if (handler != null) handler(this, EventArgs.Empty); 307 } 289 308 public event EventHandler ColumnNamesChanged; 290 309 protected virtual void OnColumnNamesChanged() {
Note: See TracChangeset
for help on using the changeset viewer.