Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/14 15:43:46 (10 years ago)
Author:
sbreuer
Message:
  • created changed event in preprocessing data
  • register to event in line chart
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/LineChartLogic.cs

    r10539 r10544  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Analysis;
     
    3233      dataTable = new DataTable("LineChart");
    3334      FillDataTable();
     35      preprocessingData.Changed += PreprocessingData_Changed;
    3436    }
    3537
     
    7779    }
    7880
     81    void PreprocessingData_Changed(object sender, DataPreprocessingChangedEventArgs e) {
     82      var variableName = preprocessingData.GetVariableName(e.Column);
     83      switch (e.Type) {
     84        case DataPreprocessingChangedEventType.DeleteColumn:
     85          dataTable.Rows.Remove(variableName);
     86          break;
     87        case DataPreprocessingChangedEventType.AddColumn:
     88          dataTable.Rows.Add(new DataRow(variableName, String.Empty, preprocessingData.GetValues<double>(e.Column)));
     89          break;
     90        case DataPreprocessingChangedEventType.ChangeColumn:
     91        case DataPreprocessingChangedEventType.ChangeItem:
     92          dataTable.Rows.Remove(variableName);
     93          dataTable.Rows.Add(new DataRow(variableName, String.Empty, preprocessingData.GetValues<double>(e.Column)));
     94          break;
     95        case DataPreprocessingChangedEventType.DeleteRow:
     96        case DataPreprocessingChangedEventType.AddRow:
     97          dataTable.Rows.Clear();
     98          FillDataTable();
     99          break;
     100      }
     101    }
    79102  }
    80103}
Note: See TracChangeset for help on using the changeset viewer.