Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9306


Ignore:
Timestamp:
03/11/13 16:47:11 (12 years ago)
Author:
sforsten
Message:

#2018:

  • renamed the structs and methods in IStringConvertibleMatrix
  • added MatrixValuesChangedEventArgs in IStringConvertibleMatrix
  • added methods SetValues(MatrixValues<T>) in ValueTypeMatrix
  • fixed bugs in StringConvertibleMatrixView: DataGridView has now at least one column and dataGridView_CellValidating does not set e.Cancel to true anymore.
Location:
branches/ImprovingStringConvertibleMatrix
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs

    r9286 r9306  
    245245      throw new NotSupportedException();
    246246    }
    247     bool IStringConvertibleMatrix.SetValue(RowColumnValue rowColumnValue) {
    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) {
    256256      var handler = ItemsChanged;
    257       if (handler != null) handler(this, new EventArgs<IEnumerable<Position>>(positions));
     257      if (handler != null) handler(this, new MatrixValuesChangedEventArgs(positions));
    258258      OnToStringChanged();
    259259    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Analysis/3.3/DataVisualization/ScatterPlot.cs

    r9286 r9306  
    259259      throw new NotSupportedException();
    260260    }
    261     bool IStringConvertibleMatrix.SetValue(RowColumnValue rowColumnValue) {
     261    bool IStringConvertibleMatrix.SetValue(MatrixValue<string> rowColumnValue) {
    262262      throw new NotSupportedException();
    263263    }
    264     bool IStringConvertibleMatrix.SetValue(IEnumerable<RowColumnValue> rowColumnValues) {
     264    bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) {
    265265      throw new NotSupportedException();
    266266    }
    267267
    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) {
    270270      var handler = ItemsChanged;
    271       if (handler != null) handler(this, new EventArgs<IEnumerable<Position>>(positions));
     271      if (handler != null) handler(this, new MatrixValuesChangedEventArgs(positions));
    272272      OnToStringChanged();
    273273    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r9286 r9306  
    8787
    8888    protected override void DeregisterContentEvents() {
    89       Content.ItemsChanged -= new EventHandler<EventArgs<IEnumerable<Position>>>(Content_ItemChanged);
     89      Content.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged);
    9090      Content.Reset -= new EventHandler(Content_Reset);
    9191      Content.ColumnNamesChanged -= new EventHandler(Content_ColumnNamesChanged);
     
    9595    protected override void RegisterContentEvents() {
    9696      base.RegisterContentEvents();
    97       Content.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Content_ItemChanged);
     97      Content.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged);
    9898      Content.Reset += new EventHandler(Content_Reset);
    9999      Content.ColumnNamesChanged += new EventHandler(Content_ColumnNamesChanged);
     
    130130      virtualRowIndices = Enumerable.Range(0, Content.Rows).ToArray();
    131131
    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 {
    135137        DataGridViewColumn[] columns = new DataGridViewColumn[Content.Columns];
    136138        for (int i = 0; i < columns.Length; ++i) {
     
    143145      }
    144146
    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;
    151148
    152149      ClearSorting();
     
    200197        UpdateColumnHeaders();
    201198    }
    202     private void Content_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     199    private void Content_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    203200      if (InvokeRequired)
    204         Invoke(new EventHandler<EventArgs<IEnumerable<Position>>>(Content_ItemChanged), sender, e);
     201        Invoke(new EventHandler<MatrixValuesChangedEventArgs>(Content_ItemChanged), sender, e);
    205202      else {
    206203        foreach (var pos in e.Value) {
     
    268265        string errorMessage;
    269266        if (Content != null && !Content.Validate(e.FormattedValue.ToString(), out errorMessage)) {
    270           e.Cancel = true;
     267          //e.Cancel = true;
    271268          dataGridView.Rows[e.RowIndex].ErrorText = errorMessage;
    272269        }
     
    376373      if (Content.Columns < values.GetLength(0) + columnIndex) Content.Columns = values.GetLength(0) + columnIndex;
    377374
    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));
    379376      for (int row = 0; row < values.GetLength(1); row++) {
    380377        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);
    386382      ClearSorting();
    387383    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/BoolMatrix.cs

    r9286 r9306  
    7474      }
    7575    }
    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.");
    7978      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);
    8586        }
    8687      }
    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));
    9388      return true;
    9489    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/DoubleMatrix.cs

    r9286 r9306  
    7474      }
    7575    }
    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
    7979      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);
    8587        }
    8688      }
    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));
    9389      return true;
    9490    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/IntMatrix.cs

    r9286 r9306  
    7474      }
    7575    }
    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.");
    7978      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);
    8586        }
    8687      }
    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));
    9388      return true;
    9489    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleMatrix.cs

    r9286 r9306  
    3737    string GetValue(int rowIndex, int columnIndex);
    3838    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);
    4141
    4242    event EventHandler ColumnsChanged;
     
    4545    event EventHandler RowNamesChanged;
    4646    event EventHandler SortableViewChanged;
    47     event EventHandler<EventArgs<IEnumerable<Position>>> ItemsChanged;
     47    event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged;
    4848    event EventHandler Reset;
    4949  }
    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() {
    5358      Row = row;
    5459      Column = column;
    5560    }
    5661  }
    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; }
    6065
    61     public RowColumnValue(Position position, string value) {
     66    public MatrixValue(MatrixPosition position, T value)
     67      : this() {
    6268      Position = position;
    6369      Value = value;
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/StringMatrix.cs

    r9286 r9306  
    128128          if ((value != null) || (matrix[rowIndex, columnIndex] != string.Empty)) {
    129129            matrix[rowIndex, columnIndex] = value != null ? value : string.Empty;
    130             OnItemsChanged(new List<Position>(1) { new Position(rowIndex, columnIndex) });
     130            OnItemsChanged(new List<MatrixPosition>(1) { new MatrixPosition(rowIndex, columnIndex) });
    131131          }
    132132        }
     
    250250      }
    251251    }
    252     protected virtual bool SetValue(IEnumerable<RowColumnValue> rowColumnValues) {
     252    public virtual bool SetValue(IEnumerable<MatrixValue<string>> matrixValues) {
    253253      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) {
    257257        pos = curValue.Position;
    258258        matrix[pos.Row, pos.Column] = curValue.Value;
    259259      }
    260       OnItemsChanged(rowColumnValues.Select(x => x.Position));
     260      OnItemsChanged(matrixValues.Select(x => x.Position));
    261261      return true;
    262262    }
     
    293293        handler(this, EventArgs.Empty);
    294294    }
    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) {
    297297      if (ItemsChanged != null)
    298         ItemsChanged(this, new EventArgs<IEnumerable<Position>>(positions));
     298        ItemsChanged(this, new MatrixValuesChangedEventArgs(positions));
    299299      OnToStringChanged();
    300300    }
     
    325325      return SetValue(value, rowIndex, columnIndex);
    326326    }
    327     public bool SetValue(RowColumnValue rowColumnValue) {
     327    public bool SetValue(MatrixValue<string> rowColumnValue) {
    328328      return SetValue(rowColumnValue.Value, rowColumnValue.Position.Row, rowColumnValue.Position.Column);
    329329    }
    330     bool IStringConvertibleMatrix.SetValue(IEnumerable<RowColumnValue> rowColumnValues) {
     330    bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) {
    331331      return SetValue(rowColumnValues);
    332332    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/ValueTypeMatrix.cs

    r9286 r9306  
    127127        if (!value.Equals(matrix[rowIndex, columnIndex])) {
    128128          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);
    132144    }
    133145
     
    247259        handler(this, EventArgs.Empty);
    248260    }
    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) {
    251263      if (ItemsChanged != null)
    252         ItemsChanged(this, new EventArgs<IEnumerable<Position>>(positions));
     264        ItemsChanged(this, new MatrixValuesChangedEventArgs(positions));
    253265      OnToStringChanged();
    254266    }
     
    264276    protected abstract bool SetValue(string value, int rowIndex, int columnIndex);
    265277    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);
    267279
    268280    #region IStringConvertibleMatrix Members
     
    286298    }
    287299
    288     bool IStringConvertibleMatrix.SetValue(RowColumnValue rowColumnValue) {
     300    bool IStringConvertibleMatrix.SetValue(MatrixValue<string> rowColumnValue) {
    289301      return SetValue(rowColumnValue.Value, rowColumnValue.Position.Row, rowColumnValue.Position.Column);
    290302    }
    291303
    292     bool IStringConvertibleMatrix.SetValue(IEnumerable<RowColumnValue> rowColumnValues) {
    293       return SetValue(rowColumnValues);
     304    bool IStringConvertibleMatrix.SetValues(IEnumerable<MatrixValue<string>> rowColumnValues) {
     305      return SetValues(rowColumnValues);
    294306    }
    295307    #endregion
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Optimization/3.3/RunCollection.cs

    r9286 r9306  
    324324    }
    325325
    326     public event EventHandler<EventArgs<IEnumerable<Position>>> ItemsChanged;
     326    public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged;
    327327    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) { new Position(rowIndex, columnIndex) }));
     328      EventHandler<MatrixValuesChangedEventArgs> handler = ItemsChanged;
     329      if (handler != null) handler(this, new MatrixValuesChangedEventArgs(new List<MatrixPosition>(1) { new MatrixPosition(rowIndex, columnIndex) }));
    330330      OnToStringChanged();
    331331    }
     
    364364    public bool Validate(string value, out string errorMessage) { throw new NotSupportedException(); }
    365365    public bool SetValue(string value, int rowIndex, int columnIndex) { throw new NotSupportedException(); }
    366     public bool SetValue(RowColumnValue rowColumnValue) { 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(); }
    368368    #endregion
    369369
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.ArtificialAnt/3.4/AntTrail.cs

    r9286 r9306  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Drawing;
    2524using HeuristicLab.Common;
     
    141140
    142141    private void RegisterWorldEvents() {
    143       World.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(World_ItemChanged);
     142      World.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(World_ItemChanged);
    144143      World.Reset += new EventHandler(World_Reset);
    145144    }
    146145    private void DeregisterWorldEvents() {
    147       World.ItemsChanged -= new EventHandler<EventArgs<IEnumerable<Position>>>(World_ItemChanged);
     146      World.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(World_ItemChanged);
    148147      World.Reset -= new EventHandler(World_Reset);
    149148    }
     
    158157      OnMaxTimeStepsChanged();
    159158    }
    160     private void World_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     159    private void World_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    161160      OnWorldChanged();
    162161    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r9286 r9306  
    234234      throw new NotSupportedException();
    235235    }
    236     public bool SetValue(RowColumnValue rowColumnValue) {
    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) {
    240240      throw new NotSupportedException();
    241241    }
     
    246246    public event EventHandler RowNamesChanged { add { } remove { } }
    247247    public event EventHandler SortableViewChanged { add { } remove { } }
    248     public event EventHandler<EventArgs<IEnumerable<Position>>> ItemsChanged { add { } remove { } }
     248    public event EventHandler<MatrixValuesChangedEventArgs> ItemsChanged { add { } remove { } }
    249249    public event EventHandler Reset { add { } remove { } }
    250250    #endregion
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r9286 r9306  
    383383      TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged);
    384384      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);
    387387      ClassificationPenaltiesParameter.Value.Reset += new EventHandler(Parameter_ValueChanged);
    388388    }
     
    390390      TargetVariableParameter.ValueChanged -= new EventHandler(TargetVariableParameter_ValueChanged);
    391391      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);
    394394      ClassificationPenaltiesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged);
    395395    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r9286 r9306  
    183183      UpdateStrategyVectorBounds();
    184184    }
    185     private void Bounds_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     185    private void Bounds_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    186186      foreach (var pos in e.Value) {
    187187        if (pos.Column == 0 && Bounds[pos.Row, 1] <= Bounds[pos.Row, 0])
     
    242242      BoundsParameter.ValueChanged += new EventHandler(BoundsParameter_ValueChanged);
    243243      Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged);
    244       Bounds.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);
     244      Bounds.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged);
    245245      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
    246246      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs

    r9286 r9306  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Drawing;
    2524using HeuristicLab.Collections;
     
    237236    }
    238237    private void RegisterBoundsEvents() {
    239       Bounds.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);
     238      Bounds.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged);
    240239      Bounds.Reset += new EventHandler(Bounds_Reset);
    241240    }
    242241    private void DeregisterBoundsEvents() {
    243       Bounds.ItemsChanged -= new EventHandler<EventArgs<IEnumerable<Position>>>(Bounds_ItemChanged);
     242      Bounds.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Bounds_ItemChanged);
    244243      Bounds.Reset -= new EventHandler(Bounds_Reset);
    245244    }
     
    269268      OnPopulationChanged();
    270269    }
    271     private void Bounds_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     270    private void Bounds_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    272271      OnBoundsChanged();
    273272    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs

    r9286 r9306  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Drawing;
    2524using HeuristicLab.Common;
     
    145144
    146145    private void RegisterCoordinatesEvents() {
    147       Coordinates.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     146      Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    148147      Coordinates.Reset += new EventHandler(Coordinates_Reset);
    149148    }
    150149    private void DeregisterCoordinatesEvents() {
    151       Coordinates.ItemsChanged -= new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     150      Coordinates.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    152151      Coordinates.Reset -= new EventHandler(Coordinates_Reset);
    153152    }
     
    167166    }
    168167
    169     private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     168    private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    170169      OnCoordinatesChanged();
    171170    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs

    r9286 r9306  
    158158    private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) {
    159159      if (Coordinates != null) {
    160         Coordinates.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     160        Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    161161        Coordinates.Reset += new EventHandler(Coordinates_Reset);
    162162      }
     
    166166      }
    167167    }
    168     private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     168    private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    169169      if (Evaluator is ITSPCoordinatesPathEvaluator) {
    170170        ClearDistanceMatrix();
     
    223223      CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
    224224      if (Coordinates != null) {
    225         Coordinates.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     225        Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    226226        Coordinates.Reset += new EventHandler(Coordinates_Reset);
    227227      }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.3/VRPSolution.cs

    r9286 r9306  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Drawing;
    2524using HeuristicLab.Common;
     
    312311
    313312    private void RegisterCoordinatesEvents() {
    314       Coordinates.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     313      Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    315314      Coordinates.Reset += new EventHandler(Coordinates_Reset);
    316315    }
    317316    private void DeregisterCoordinatesEvents() {
    318       Coordinates.ItemsChanged -= new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     317      Coordinates.ItemsChanged -= new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    319318      Coordinates.Reset -= new EventHandler(Coordinates_Reset);
    320319    }
     
    362361    }
    363362
    364     private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     363    private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    365364      OnCoordinatesChanged();
    366365    }
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs

    r9286 r9306  
    212212    }
    213213    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);
    215215      Coordinates.Reset += new EventHandler(Coordinates_Reset);
    216216      ParameterizeSolutionCreator();
     
    219219      BestKnownSolution = null;
    220220    }
    221     private void Coordinates_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     221    private void Coordinates_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    222222      ClearDistanceMatrix();
    223223
     
    271271    void DistanceMatrixParameter_ValueChanged(object sender, EventArgs e) {
    272272      if (DistanceMatrix != null) {
    273         DistanceMatrix.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);
     273        DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged);
    274274        DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset);
    275275      }
     
    279279      EvalBestKnownSolution();
    280280    }
    281     void DistanceMatrix_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     281    void DistanceMatrix_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    282282      EvalBestKnownSolution();
    283283    }
     
    367367    private void RegisterEventHandlers() {
    368368      CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
    369       Coordinates.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(Coordinates_ItemChanged);
     369      Coordinates.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(Coordinates_ItemChanged);
    370370      Coordinates.Reset += new EventHandler(Coordinates_Reset);
    371371
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r9286 r9306  
    281281      DistanceMatrixParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged);
    282282      if (DistanceMatrix != null) {
    283         DistanceMatrix.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);
     283        DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged);
    284284        DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset);
    285285      }
     
    311311    void DistanceMatrixParameter_ValueChanged(object sender, EventArgs e) {
    312312      if (DistanceMatrix != null) {
    313         DistanceMatrix.ItemsChanged += new EventHandler<EventArgs<IEnumerable<Position>>>(DistanceMatrix_ItemChanged);
     313        DistanceMatrix.ItemsChanged += new EventHandler<MatrixValuesChangedEventArgs>(DistanceMatrix_ItemChanged);
    314314        DistanceMatrix.Reset += new EventHandler(DistanceMatrix_Reset);
    315315      }
     
    320320      EvalBestKnownSolution();
    321321    }
    322     void DistanceMatrix_ItemChanged(object sender, EventArgs<IEnumerable<Position>> e) {
     322    void DistanceMatrix_ItemChanged(object sender, MatrixValuesChangedEventArgs e) {
    323323      distanceMatrix = DistanceMatrix;
    324324      EvalBestKnownSolution();
Note: See TracChangeset for help on using the changeset viewer.