Changeset 9306
- Timestamp:
- 03/11/13 16:47:11 (12 years ago)
- Location:
- branches/ImprovingStringConvertibleMatrix
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r9286 r9306 245 245 throw new NotSupportedException(); 246 246 } 247 bool IStringConvertibleMatrix.SetValue( RowColumnValuerowColumnValue) {248 throw new NotSupportedException(); 249 } 250 bool IStringConvertibleMatrix.SetValue (IEnumerable<RowColumnValue> rowColumnValues) {251 throw new NotSupportedException(); 252 } 253 254 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;255 protected virtual void OnItemsChanged(IEnumerable< Position> positions) {247 bool IStringConvertibleMatrix.SetValue(MatrixValue<string> rowColumnValue) { 248 throw new NotSupportedException(); 249 } 250 bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { 251 throw new NotSupportedException(); 252 } 253 254 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 255 protected virtual void OnItemsChanged(IEnumerable<MatrixPosition> positions) { 256 256 var handler = ItemsChanged; 257 if (handler != null) handler(this, new EventArgs<IEnumerable<Position>>(positions));257 if (handler != null) handler(this, new MatrixValuesChangedEventArgs(positions)); 258 258 OnToStringChanged(); 259 259 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Analysis/3.3/DataVisualization/ScatterPlot.cs
r9286 r9306 259 259 throw new NotSupportedException(); 260 260 } 261 bool IStringConvertibleMatrix.SetValue( RowColumnValuerowColumnValue) {261 bool IStringConvertibleMatrix.SetValue(MatrixValue<string> rowColumnValue) { 262 262 throw new NotSupportedException(); 263 263 } 264 bool IStringConvertibleMatrix.SetValue (IEnumerable<RowColumnValue> rowColumnValues) {264 bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { 265 265 throw new NotSupportedException(); 266 266 } 267 267 268 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;269 protected virtual void OnItemsChanged(IEnumerable< Position> positions) {268 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 269 protected virtual void OnItemsChanged(IEnumerable<MatrixPosition> positions) { 270 270 var handler = ItemsChanged; 271 if (handler != null) handler(this, new EventArgs<IEnumerable<Position>>(positions));271 if (handler != null) handler(this, new MatrixValuesChangedEventArgs(positions)); 272 272 OnToStringChanged(); 273 273 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r9286 r9306 87 87 88 88 protected override void DeregisterContentEvents() { 89 Content.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Content_ItemChanged);89 Content.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged); 90 90 Content.Reset -= new EventHandler(Content_Reset); 91 91 Content.ColumnNamesChanged -= new EventHandler(Content_ColumnNamesChanged); … … 95 95 protected override void RegisterContentEvents() { 96 96 base.RegisterContentEvents(); 97 Content.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Content_ItemChanged);97 Content.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged); 98 98 Content.Reset += new EventHandler(Content_Reset); 99 99 Content.ColumnNamesChanged += new EventHandler(Content_ColumnNamesChanged); … … 130 130 virtualRowIndices = Enumerable.Range(0, Content.Rows).ToArray(); 131 131 132 if (Content.Columns == 0 && dataGridView.ColumnCount != Content.Columns && !Content.ReadOnly) 133 Content.Columns = dataGridView.ColumnCount; 134 else { 132 //dataGridView.RowCount = 0; 133 134 if (Content.Columns == 0) { 135 Content.Columns = 1; 136 } else { 135 137 DataGridViewColumn[] columns = new DataGridViewColumn[Content.Columns]; 136 138 for (int i = 0; i < columns.Length; ++i) { … … 143 145 } 144 146 145 //DataGridViews with rows but no columns are not allowed ! 146 if (Content.Rows == 0 && dataGridView.RowCount != Content.Rows && !Content.ReadOnly) 147 Content.Rows = dataGridView.RowCount; 148 else 149 dataGridView.RowCount = Content.Rows; 150 147 dataGridView.RowCount = Content.Rows; 151 148 152 149 ClearSorting(); … … 200 197 UpdateColumnHeaders(); 201 198 } 202 private void Content_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {199 private void Content_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 203 200 if (InvokeRequired) 204 Invoke(new EventHandler< EventArgs<IEnumerable<Position>>>(Content_ItemChanged), sender, e);201 Invoke(new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged), sender, e); 205 202 else { 206 203 foreach (var pos in e.Value) { … … 268 265 string errorMessage; 269 266 if (Content != null && !Content.Validate(e.FormattedValue.ToString(), out errorMessage)) { 270 e.Cancel = true;267 //e.Cancel = true; 271 268 dataGridView.Rows[e.RowIndex].ErrorText = errorMessage; 272 269 } … … 376 373 if (Content.Columns < values.GetLength(0) + columnIndex) Content.Columns = values.GetLength(0) + columnIndex; 377 374 378 List< RowColumnValue> setValues = new List<RowColumnValue>(values.GetLength(0) * values.GetLength(1));375 List<MatrixValue<string>> setValues = new List<MatrixValue<string>>(values.GetLength(0) * values.GetLength(1)); 379 376 for (int row = 0; row < values.GetLength(1); row++) { 380 377 for (int col = 0; col < values.GetLength(0); col++) { 381 setValues.Add(new RowColumnValue(new Position(row + rowIndex, col + columnIndex), values[col, row])); 382 //Content.SetValue(values[col, row], row + rowIndex, col + columnIndex); 383 } 384 } 385 Content.SetValue(setValues); 378 setValues.Add(new MatrixValue<string>(new MatrixPosition(row + rowIndex, col + columnIndex), values[col, row])); 379 } 380 } 381 Content.SetValues(setValues); 386 382 ClearSorting(); 387 383 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/BoolMatrix.cs
r9286 r9306 74 74 } 75 75 } 76 protected override bool SetValue(IEnumerable<RowColumnValue> rowColumnValues) { 77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. StringMatrix is read-only."); 78 List<Tuple<Position, bool>> newValues = new List<Tuple<Position, bool>>(); 76 protected override bool SetValues(IEnumerable<MatrixValue<string>> matrixValues) { 77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. BoolMatrix is read-only."); 79 78 bool parsed; 80 foreach (var curValue in rowColumnValues) { 81 if (bool.TryParse(curValue.Value, out parsed)) { 82 newValues.Add(new Tuple<Position, bool>(curValue.Position, parsed)); 83 } else { 84 return false; 79 if (!matrixValues.All(v => bool.TryParse(v.Value, out parsed))) return false; 80 List<MatrixPosition> positions = new List<MatrixPosition>(); 81 foreach (var v in matrixValues) { 82 parsed = bool.Parse(v.Value); 83 if (matrix[v.Position.Row, v.Position.Column] != parsed) { 84 matrix[v.Position.Row, v.Position.Column] = parsed; 85 positions.Add(v.Position); 85 86 } 86 87 } 87 Position pos;88 foreach (var curValue in newValues) {89 pos = curValue.Item1;90 matrix[pos.Row, pos.Column] = curValue.Item2;91 }92 OnItemsChanged(rowColumnValues.Select(x => x.Position));93 88 return true; 94 89 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/DoubleMatrix.cs
r9286 r9306 74 74 } 75 75 } 76 protected override bool SetValue (IEnumerable<RowColumnValue> rowColumnValues) {77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. StringMatrix is read-only.");78 List<Tuple<Position, double>> newValues = new List<Tuple<Position, double>>(); 76 protected override bool SetValues(IEnumerable<MatrixValue<string>> matrixValues) { 77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. DoubleMatrix is read-only."); 78 79 79 double parsed; 80 foreach (var curValue in rowColumnValues) { 81 if (double.TryParse(curValue.Value, out parsed)) { 82 newValues.Add(new Tuple<Position, double>(curValue.Position, parsed)); 83 } else { 84 return false; 80 if (!matrixValues.All(v => double.TryParse(v.Value, out parsed))) return false; 81 List<MatrixPosition> positions = new List<MatrixPosition>(); 82 foreach (var v in matrixValues) { 83 parsed = double.Parse(v.Value); 84 if (matrix[v.Position.Row, v.Position.Column] != parsed) { 85 matrix[v.Position.Row, v.Position.Column] = parsed; 86 positions.Add(v.Position); 85 87 } 86 88 } 87 Position pos;88 foreach (var curValue in newValues) {89 pos = curValue.Item1;90 matrix[pos.Row, pos.Column] = curValue.Item2;91 }92 OnItemsChanged(rowColumnValues.Select(x => x.Position));93 89 return true; 94 90 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/IntMatrix.cs
r9286 r9306 74 74 } 75 75 } 76 protected override bool SetValue(IEnumerable<RowColumnValue> rowColumnValues) { 77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. StringMatrix is read-only."); 78 List<Tuple<Position, int>> newValues = new List<Tuple<Position, int>>(); 76 protected override bool SetValues(IEnumerable<MatrixValue<string>> matrixValues) { 77 if (ReadOnly) throw new NotSupportedException("Item cannot be set. IntMatrix is read-only."); 79 78 int parsed; 80 foreach (var curValue in rowColumnValues) { 81 if (int.TryParse(curValue.Value, out parsed)) { 82 newValues.Add(new Tuple<Position, int>(curValue.Position, parsed)); 83 } else { 84 return false; 79 if (!matrixValues.All(v => int.TryParse(v.Value, out parsed))) return false; 80 List<MatrixPosition> positions = new List<MatrixPosition>(); 81 foreach (var v in matrixValues) { 82 parsed = int.Parse(v.Value); 83 if (matrix[v.Position.Row, v.Position.Column] != parsed) { 84 matrix[v.Position.Row, v.Position.Column] = parsed; 85 positions.Add(v.Position); 85 86 } 86 87 } 87 Position pos;88 foreach (var curValue in newValues) {89 pos = curValue.Item1;90 matrix[pos.Row, pos.Column] = curValue.Item2;91 }92 OnItemsChanged(rowColumnValues.Select(x => x.Position));93 88 return true; 94 89 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleMatrix.cs
r9286 r9306 37 37 string GetValue(int rowIndex, int columnIndex); 38 38 bool SetValue(string value, int rowIndex, int columnIndex); 39 bool SetValue( RowColumnValue rowColumnValue);40 bool SetValue (IEnumerable<RowColumnValue> rowColumnValues);39 bool SetValue(MatrixValue<string> matrixValue); 40 bool SetValues(IEnumerable<MatrixValue<string>> matrixValues); 41 41 42 42 event EventHandler ColumnsChanged; … … 45 45 event EventHandler RowNamesChanged; 46 46 event EventHandler SortableViewChanged; 47 event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;47 event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 48 48 event EventHandler Reset; 49 49 } 50 public struct Position { 51 public readonly int Row, Column; 52 public Position(int row, int column) { 50 public class MatrixValuesChangedEventArgs : EventArgs<IEnumerable<MatrixPosition>> { 51 public MatrixValuesChangedEventArgs(IEnumerable<MatrixPosition> matrixPositions) : base(matrixPositions) { } 52 } 53 public struct MatrixPosition { 54 public int Row { get; private set; } 55 public int Column { get; private set; } 56 public MatrixPosition(int row, int column) 57 : this() { 53 58 Row = row; 54 59 Column = column; 55 60 } 56 61 } 57 public struct RowColumnValue{58 public readonly Position Position;59 public readonly string Value;62 public struct MatrixValue<T> { 63 public MatrixPosition Position { get; private set; } 64 public T Value { get; private set; } 60 65 61 public RowColumnValue(Position position, string value) { 66 public MatrixValue(MatrixPosition position, T value) 67 : this() { 62 68 Position = position; 63 69 Value = value; -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/StringMatrix.cs
r9286 r9306 128 128 if ((value != null) || (matrix[rowIndex, columnIndex] != string.Empty)) { 129 129 matrix[rowIndex, columnIndex] = value != null ? value : string.Empty; 130 OnItemsChanged(new List< Position>(1) { newPosition(rowIndex, columnIndex) });130 OnItemsChanged(new List<MatrixPosition>(1) { new MatrixPosition(rowIndex, columnIndex) }); 131 131 } 132 132 } … … 250 250 } 251 251 } 252 p rotected virtual bool SetValue(IEnumerable<RowColumnValue> rowColumnValues) {252 public virtual bool SetValue(IEnumerable<MatrixValue<string>> matrixValues) { 253 253 if (ReadOnly) throw new NotSupportedException("Item cannot be set. StringMatrix is read-only."); 254 if ( rowColumnValues.Any(x => x.Value == null)) { return false; }255 Position pos;256 foreach (var curValue in rowColumnValues) {254 if (!matrixValues.All(v => v.Value != null)) return false; 255 MatrixPosition pos; 256 foreach (var curValue in matrixValues) { 257 257 pos = curValue.Position; 258 258 matrix[pos.Row, pos.Column] = curValue.Value; 259 259 } 260 OnItemsChanged( rowColumnValues.Select(x => x.Position));260 OnItemsChanged(matrixValues.Select(x => x.Position)); 261 261 return true; 262 262 } … … 293 293 handler(this, EventArgs.Empty); 294 294 } 295 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;296 protected virtual void OnItemsChanged(IEnumerable< Position> positions) {295 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 296 protected virtual void OnItemsChanged(IEnumerable<MatrixPosition> positions) { 297 297 if (ItemsChanged != null) 298 ItemsChanged(this, new EventArgs<IEnumerable<Position>>(positions));298 ItemsChanged(this, new MatrixValuesChangedEventArgs(positions)); 299 299 OnToStringChanged(); 300 300 } … … 325 325 return SetValue(value, rowIndex, columnIndex); 326 326 } 327 public bool SetValue( RowColumnValuerowColumnValue) {327 public bool SetValue(MatrixValue<string> rowColumnValue) { 328 328 return SetValue(rowColumnValue.Value, rowColumnValue.Position.Row, rowColumnValue.Position.Column); 329 329 } 330 bool IStringConvertibleMatrix.SetValue (IEnumerable<RowColumnValue> rowColumnValues) {330 bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { 331 331 return SetValue(rowColumnValues); 332 332 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r9286 r9306 127 127 if (!value.Equals(matrix[rowIndex, columnIndex])) { 128 128 matrix[rowIndex, columnIndex] = value; 129 OnItemsChanged(new List<Position>(1) { new Position(rowIndex, columnIndex) }); 130 } 131 } 129 OnItemsChanged(new List<MatrixPosition>(1) { new MatrixPosition(rowIndex, columnIndex) }); 130 } 131 } 132 } 133 134 public virtual void SetValues(IEnumerable<MatrixValue<T>> matrixValues) { 135 if (ReadOnly) throw new NotSupportedException("Item cannot be set. ValueTypeMatrix is read-only."); 136 List<MatrixPosition> positions = new List<MatrixPosition>(); 137 foreach (var matrixValue in matrixValues) { 138 if (!matrixValue.Value.Equals(matrix[matrixValue.Position.Row, matrixValue.Position.Column])) { 139 matrix[matrixValue.Position.Row, matrixValue.Position.Column] = matrixValue.Value; 140 positions.Add(matrixValue.Position); 141 } 142 } 143 OnItemsChanged(positions); 132 144 } 133 145 … … 247 259 handler(this, EventArgs.Empty); 248 260 } 249 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;250 protected virtual void OnItemsChanged(IEnumerable< Position> positions) {261 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 262 protected virtual void OnItemsChanged(IEnumerable<MatrixPosition> positions) { 251 263 if (ItemsChanged != null) 252 ItemsChanged(this, new EventArgs<IEnumerable<Position>>(positions));264 ItemsChanged(this, new MatrixValuesChangedEventArgs(positions)); 253 265 OnToStringChanged(); 254 266 } … … 264 276 protected abstract bool SetValue(string value, int rowIndex, int columnIndex); 265 277 protected abstract string GetValue(int rowIndex, int columIndex); 266 protected abstract bool SetValue (IEnumerable<RowColumnValue> rowColumnValues);278 protected abstract bool SetValues(IEnumerable<MatrixValue<string>> rowColumnValues); 267 279 268 280 #region IStringConvertibleMatrix Members … … 286 298 } 287 299 288 bool IStringConvertibleMatrix.SetValue( RowColumnValuerowColumnValue) {300 bool IStringConvertibleMatrix.SetValue(MatrixValue<string> rowColumnValue) { 289 301 return SetValue(rowColumnValue.Value, rowColumnValue.Position.Row, rowColumnValue.Position.Column); 290 302 } 291 303 292 bool IStringConvertibleMatrix.SetValue (IEnumerable<RowColumnValue> rowColumnValues) {293 return SetValue (rowColumnValues);304 bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { 305 return SetValues(rowColumnValues); 294 306 } 295 307 #endregion -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Optimization/3.3/RunCollection.cs
r9286 r9306 324 324 } 325 325 326 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged;326 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged; 327 327 protected virtual void OnItemsChanged(int rowIndex, int columnIndex) { 328 EventHandler< EventArgs<IEnumerable<Position>>> handler = ItemsChanged;329 if (handler != null) handler(this, new EventArgs<IEnumerable<Position>>(new List<Position>(1) { newPosition(rowIndex, columnIndex) }));328 EventHandler<MatrixValuesChangedEventArgs> handler = ItemsChanged; 329 if (handler != null) handler(this, new MatrixValuesChangedEventArgs(new List<MatrixPosition>(1) { new MatrixPosition(rowIndex, columnIndex) })); 330 330 OnToStringChanged(); 331 331 } … … 364 364 public bool Validate(string value, out string errorMessage) { throw new NotSupportedException(); } 365 365 public bool SetValue(string value, int rowIndex, int columnIndex) { throw new NotSupportedException(); } 366 public bool SetValue( RowColumnValuerowColumnValue) { throw new NotSupportedException(); }367 public bool SetValue (IEnumerable<RowColumnValue> rowColumnValues) { throw new NotSupportedException(); }366 public bool SetValue(MatrixValue<string> rowColumnValue) { throw new NotSupportedException(); } 367 public bool SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { throw new NotSupportedException(); } 368 368 #endregion 369 369 -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.ArtificialAnt/3.4/AntTrail.cs
r9286 r9306 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Drawing; 25 24 using HeuristicLab.Common; … … 141 140 142 141 private void RegisterWorldEvents() { 143 World.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(World_ItemChanged);142 World.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(World_ItemChanged); 144 143 World.Reset += new EventHandler(World_Reset); 145 144 } 146 145 private void DeregisterWorldEvents() { 147 World.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(World_ItemChanged);146 World.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(World_ItemChanged); 148 147 World.Reset -= new EventHandler(World_Reset); 149 148 } … … 158 157 OnMaxTimeStepsChanged(); 159 158 } 160 private void World_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {159 private void World_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 161 160 OnWorldChanged(); 162 161 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r9286 r9306 234 234 throw new NotSupportedException(); 235 235 } 236 public bool SetValue( RowColumnValuerowColumnValue) {237 throw new NotSupportedException(); 238 } 239 public bool SetValue (IEnumerable<RowColumnValue> rowColumnValues) {236 public bool SetValue(MatrixValue<string> rowColumnValue) { 237 throw new NotSupportedException(); 238 } 239 public bool SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) { 240 240 throw new NotSupportedException(); 241 241 } … … 246 246 public event EventHandler RowNamesChanged { add { } remove { } } 247 247 public event EventHandler SortableViewChanged { add { } remove { } } 248 public event EventHandler< EventArgs<IEnumerable<Position>>> ItemsChanged { add { } remove { } }248 public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged { add { } remove { } } 249 249 public event EventHandler Reset { add { } remove { } } 250 250 #endregion -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r9286 r9306 383 383 TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged); 384 384 ClassNamesParameter.Value.Reset += new EventHandler(Parameter_ValueChanged); 385 ClassNamesParameter.Value.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Parameter_ValueChanged);386 ClassificationPenaltiesParameter.Value.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Parameter_ValueChanged);385 ClassNamesParameter.Value.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Parameter_ValueChanged); 386 ClassificationPenaltiesParameter.Value.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Parameter_ValueChanged); 387 387 ClassificationPenaltiesParameter.Value.Reset += new EventHandler(Parameter_ValueChanged); 388 388 } … … 390 390 TargetVariableParameter.ValueChanged -= new EventHandler(TargetVariableParameter_ValueChanged); 391 391 ClassNamesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged); 392 ClassNamesParameter.Value.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Parameter_ValueChanged);393 ClassificationPenaltiesParameter.Value.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Parameter_ValueChanged);392 ClassNamesParameter.Value.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Parameter_ValueChanged); 393 ClassificationPenaltiesParameter.Value.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Parameter_ValueChanged); 394 394 ClassificationPenaltiesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged); 395 395 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r9286 r9306 183 183 UpdateStrategyVectorBounds(); 184 184 } 185 private void Bounds_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {185 private void Bounds_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 186 186 foreach (var pos in e.Value) { 187 187 if (pos.Column == 0 && Bounds[pos.Row, 1] <= Bounds[pos.Row, 0]) … … 242 242 BoundsParameter.ValueChanged += new EventHandler(BoundsParameter_ValueChanged); 243 243 Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged); 244 Bounds.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);244 Bounds.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged); 245 245 SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged); 246 246 Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs
r9286 r9306 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Drawing; 25 24 using HeuristicLab.Collections; … … 237 236 } 238 237 private void RegisterBoundsEvents() { 239 Bounds.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);238 Bounds.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged); 240 239 Bounds.Reset += new EventHandler(Bounds_Reset); 241 240 } 242 241 private void DeregisterBoundsEvents() { 243 Bounds.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);242 Bounds.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged); 244 243 Bounds.Reset -= new EventHandler(Bounds_Reset); 245 244 } … … 269 268 OnPopulationChanged(); 270 269 } 271 private void Bounds_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {270 private void Bounds_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 272 271 OnBoundsChanged(); 273 272 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs
r9286 r9306 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Drawing; 25 24 using HeuristicLab.Common; … … 145 144 146 145 private void RegisterCoordinatesEvents() { 147 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);146 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 148 147 Coordinates.Reset += new EventHandler(Coordinates_Reset); 149 148 } 150 149 private void DeregisterCoordinatesEvents() { 151 Coordinates.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);150 Coordinates.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 152 151 Coordinates.Reset -= new EventHandler(Coordinates_Reset); 153 152 } … … 167 166 } 168 167 169 private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {168 private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 170 169 OnCoordinatesChanged(); 171 170 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r9286 r9306 158 158 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 159 159 if (Coordinates != null) { 160 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);160 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 161 161 Coordinates.Reset += new EventHandler(Coordinates_Reset); 162 162 } … … 166 166 } 167 167 } 168 private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {168 private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 169 169 if (Evaluator is ITSPCoordinatesPathEvaluator) { 170 170 ClearDistanceMatrix(); … … 223 223 CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 224 224 if (Coordinates != null) { 225 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);225 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 226 226 Coordinates.Reset += new EventHandler(Coordinates_Reset); 227 227 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.3/VRPSolution.cs
r9286 r9306 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Drawing; 25 24 using HeuristicLab.Common; … … 312 311 313 312 private void RegisterCoordinatesEvents() { 314 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);313 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 315 314 Coordinates.Reset += new EventHandler(Coordinates_Reset); 316 315 } 317 316 private void DeregisterCoordinatesEvents() { 318 Coordinates.ItemsChanged -= new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);317 Coordinates.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 319 318 Coordinates.Reset -= new EventHandler(Coordinates_Reset); 320 319 } … … 362 361 } 363 362 364 private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {363 private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 365 364 OnCoordinatesChanged(); 366 365 } -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs
r9286 r9306 212 212 } 213 213 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 214 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);214 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 215 215 Coordinates.Reset += new EventHandler(Coordinates_Reset); 216 216 ParameterizeSolutionCreator(); … … 219 219 BestKnownSolution = null; 220 220 } 221 private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {221 private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 222 222 ClearDistanceMatrix(); 223 223 … … 271 271 void DistanceMatrixParameter_ValueChanged(object sender, EventArgs e) { 272 272 if (DistanceMatrix != null) { 273 DistanceMatrix.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);273 DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged); 274 274 DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset); 275 275 } … … 279 279 EvalBestKnownSolution(); 280 280 } 281 void DistanceMatrix_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {281 void DistanceMatrix_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 282 282 EvalBestKnownSolution(); 283 283 } … … 367 367 private void RegisterEventHandlers() { 368 368 CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 369 Coordinates.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);369 Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged); 370 370 Coordinates.Reset += new EventHandler(Coordinates_Reset); 371 371 -
branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r9286 r9306 281 281 DistanceMatrixParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged); 282 282 if (DistanceMatrix != null) { 283 DistanceMatrix.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);283 DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged); 284 284 DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset); 285 285 } … … 311 311 void DistanceMatrixParameter_ValueChanged(object sender, EventArgs e) { 312 312 if (DistanceMatrix != null) { 313 DistanceMatrix.ItemsChanged += new EventHandler< EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);313 DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged); 314 314 DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset); 315 315 } … … 320 320 EvalBestKnownSolution(); 321 321 } 322 void DistanceMatrix_ItemChanged(object sender, EventArgs<IEnumerable<Position>>e) {322 void DistanceMatrix_ItemChanged(object sender, MatrixValuesChangedEventArgs e) { 323 323 distanceMatrix = DistanceMatrix; 324 324 EvalBestKnownSolution();
Note: See TracChangeset
for help on using the changeset viewer.