Changeset 5150
- Timestamp:
- 12/21/10 16:08:55 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r5097 r5150 128 128 foreach (DataRow row in e.Items) 129 129 this.RegisterRowEvents(row); 130 131 this.OnColumnsChanged(); 130 132 this.OnColumnNamesChanged(); 131 133 this.OnReset(); … … 134 136 foreach (DataRow row in e.Items) 135 137 this.DeregisterRowEvents(row); 138 139 this.OnColumnsChanged(); 136 140 this.OnColumnNamesChanged(); 137 141 this.OnReset(); … … 142 146 foreach (DataRow row in e.Items) 143 147 this.RegisterRowEvents(row); 148 149 this.OnColumnsChanged(); 144 150 this.OnColumnNamesChanged(); 145 151 this.OnReset(); … … 150 156 foreach (DataRow row in e.Items) 151 157 this.RegisterRowEvents(row); 158 159 if (e.OldItems.Count() != e.Items.Count()) 160 this.OnColumnsChanged(); 152 161 this.OnColumnNamesChanged(); 153 162 this.OnReset(); … … 239 248 if (handler != null) handler(this, EventArgs.Empty); 240 249 } 250 public event EventHandler ColumnsChanged; 251 protected virtual void OnColumnsChanged() { 252 var handler = ColumnsChanged; 253 if (handler != null) handler(this, EventArgs.Empty); 254 } 255 public event EventHandler RowsChanged; 256 protected virtual void OnRowsChanged() { 257 var handler = RowsChanged; 258 if (handler != null) handler(this, EventArgs.Empty); 259 } 241 260 public event EventHandler ColumnNamesChanged; 242 261 protected virtual void OnColumnNamesChanged() { -
trunk/sources/HeuristicLab.Data/3.3/IStringConvertibleMatrix.cs
r4477 r5150 38 38 bool SetValue(string value, int rowIndex, int columnIndex); 39 39 40 event EventHandler ColumnsChanged; 41 event EventHandler RowsChanged; 40 42 event EventHandler ColumnNamesChanged; 41 43 event EventHandler RowNamesChanged; … … 43 45 event EventHandler<EventArgs<int, int>> ItemChanged; 44 46 event EventHandler Reset; 47 45 48 } 46 49 } -
trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs
r4722 r5150 53 53 else 54 54 columnNames = new List<string>(value); 55 OnColumnNamesChanged(); 55 56 } 56 57 } … … 67 68 else 68 69 rowNames = new List<string>(value); 70 OnRowNamesChanged(); 69 71 } 70 72 } … … 94 96 while (rowNames.Count < value) 95 97 rowNames.Add("Row " + rowNames.Count); 98 OnRowsChanged(); 99 OnRowNamesChanged(); 96 100 OnReset(); 97 101 } … … 111 115 while (columnNames.Count < value) 112 116 columnNames.Add("Column " + columnNames.Count); 117 OnColumnsChanged(); 118 OnColumnNamesChanged(); 113 119 OnReset(); 114 120 } … … 167 173 } 168 174 protected StringMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) 169 : this(rows, columns, columnNames) {175 : this(rows, columns, columnNames) { 170 176 RowNames = rowNames; 171 177 } … … 186 192 ColumnNames = columnNames; 187 193 } 188 protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames)189 : this(elements, columnNames) {194 protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) 195 : this(elements, columnNames) { 190 196 RowNames = rowNames; 191 197 } … … 245 251 } 246 252 253 #region events 254 public event EventHandler ColumnsChanged; 255 protected virtual void OnColumnsChanged() { 256 EventHandler handler = ColumnsChanged; 257 if (handler != null) 258 handler(this, EventArgs.Empty); 259 } 260 public event EventHandler RowsChanged; 261 protected virtual void OnRowsChanged() { 262 EventHandler handler = RowsChanged; 263 if (handler != null) 264 handler(this, EventArgs.Empty); 265 } 247 266 public event EventHandler ColumnNamesChanged; 248 267 protected virtual void OnColumnNamesChanged() { … … 275 294 OnToStringChanged(); 276 295 } 296 #endregion 277 297 278 298 #region IStringConvertibleMatrix Members -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r4722 r5150 53 53 else 54 54 columnNames = new List<string>(value); 55 OnColumnNamesChanged(); 55 56 } 56 57 } … … 67 68 else 68 69 rowNames = new List<string>(value); 70 OnRowNamesChanged(); 69 71 } 70 72 } … … 94 96 while (rowNames.Count < value) 95 97 rowNames.Add("Row " + rowNames.Count); 98 OnRowsChanged(); 99 OnRowNamesChanged(); 96 100 OnReset(); 97 101 } … … 111 115 while (columnNames.Count < value) 112 116 columnNames.Add("Column " + columnNames.Count); 117 OnColumnsChanged(); 118 OnColumnNamesChanged(); 113 119 OnReset(); 114 120 } … … 177 183 } 178 184 protected ValueTypeMatrix(T[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) 179 : this(elements, columnNames) {185 : this(elements, columnNames) { 180 186 RowNames = rowNames; 181 187 } … … 210 216 } 211 217 218 #region events 219 public event EventHandler ColumnsChanged; 220 protected virtual void OnColumnsChanged() { 221 EventHandler handler = ColumnsChanged; 222 if (handler != null) 223 handler(this, EventArgs.Empty); 224 } 225 public event EventHandler RowsChanged; 226 protected virtual void OnRowsChanged() { 227 EventHandler handler = RowsChanged; 228 if (handler != null) 229 handler(this, EventArgs.Empty); 230 } 212 231 public event EventHandler ColumnNamesChanged; 213 232 protected virtual void OnColumnNamesChanged() { 214 233 EventHandler handler = ColumnNamesChanged; 215 if (handler!=null)216 handler(this, EventArgs.Empty);234 if (handler != null) 235 handler(this, EventArgs.Empty); 217 236 } 218 237 public event EventHandler RowNamesChanged; … … 240 259 OnToStringChanged(); 241 260 } 261 #endregion 242 262 } 243 263 } -
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() { -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs
r4722 r5150 187 187 } 188 188 189 public event EventHandler ColumnsChanged; 190 private void OnColumnsChanged() { 191 var handler = ColumnsChanged; 192 if (handler != null) handler(this, EventArgs.Empty); 193 } 194 public event EventHandler RowsChanged; 195 private void OnRowsChanged() { 196 var handler = RowsChanged; 197 if (handler != null) handler(this, EventArgs.Empty); 198 } 189 199 public event EventHandler ColumnNamesChanged; 190 200 private void OnColumnNamesChanged() {
Note: See TracChangeset
for help on using the changeset viewer.